deno fmt and new types

main
emehmet 3 years ago
parent 7d389f3d52
commit fcc6523c67

@ -1,128 +1,151 @@
import { MongoClient, ObjectId, BSON, BSONType, Decimal128, Binary } from 'npm:mongodb';
// import {
// Binary,
// BSON,
// BSONType,
// Decimal128,
// MongoClient,
// ObjectId,
// } from "npm:mongodb";
interface Schema {
[key: string]: {
type: string;
required: boolean;
};
}
// interface Schema {
// [key: string]: {
// type: string;
// required: boolean;
// };
// }
// interface MongoTypeMap {
// String: string;
// Integer: number;
// Double: number;
// Decimal128: number;
// Object: object;
// Array: any[];
// Binary: Uint8Array;
// Timestamp: Date;
// Date: Date;
// ObjectId: string;
// Boolean: boolean;
// }
// type MongoTypeKeys = keyof MongoTypeMap;
// function getFieldTypeFromValue(value: unknown): Record<string, unknown> {
// if (value instanceof ObjectId) {
// return ObjectId;
// }
// if (value instanceof Date) {
// return Date;
// }
// if (value instanceof Decimal128) {
// return Number;
// }
// if (value instanceof Binary) {
// return "Binary";
// }
// if (Array.isArray(value)) {
// const [firstElem] = value;
// const innerType = getFieldTypeFromValue(firstElem);
// return `${innerType}[]`;
// }
// if (typeof value === "object" && value !== null) {
// const keys = Object.keys(value);
// const innerTypes = keys.map((key) => {
// const innerValue = value[key];
// const innerType = getFieldTypeFromValue(innerValue);
// return `${key}: ${innerType}`;
// });
// return `{ ${innerTypes.join(", ")} }`;
// }
// return typeof value;
// }
interface MongoTypeMap {
String: string;
Integer: number;
Double: number;
Decimal128: number;
Object: object;
Array: any[];
Binary: Uint8Array;
Timestamp: Date;
Date: Date;
ObjectId: string;
Boolean: boolean;
}
// function mongoSchemaToType(schema: Record<string, string>): string {
// const fields: Record<string, (string[] | string)> = {};
type MongoTypeKeys = keyof MongoTypeMap;
function getFieldTypeFromValue(value: any): any {
console.log(value instanceof Date)
if (value instanceof ObjectId) {
return ObjectId;
}
if (value instanceof Date) {
return Date;
}
if (value instanceof Decimal128) {
return Number;
}
if (value instanceof Binary) {
return 'Binary';
}
if (Array.isArray(value)) {
const [firstElem] = value;
const innerType = getFieldTypeFromValue(firstElem);
return `${innerType}[]`;
}
if (typeof value === 'object' && value !== null) {
const keys = Object.keys(value);
const innerTypes = keys.map((key) => {
const innerValue = value[key];
const innerType = getFieldTypeFromValue(innerValue);
return `${key}: ${innerType}`;
});
return `{ ${innerTypes.join(', ')} }`;
}
return typeof value;
}
// for (const [key, value] of Object.entries(schema)) {
// console.log(
// "🚀 ~ file: convert_types.ts:105 ~ mongoSchemaToType ~ value:",
// value,
// );
// if (Array.isArray(value)) {
// fields[key] = "Array";
function mongoSchemaToType(schema: any): any {
const fields: any = {};
// if (value.length > 0) {
// const subType = getFieldTypeFromValue(value[0]);
// if (subType === "Object") {
// fields[key] = [mongoSchemaToType(value[0])];
// } else {
// fields[key] = [subType];
// }
// }
// // } else if (typeof value === "object" && value !== null) {
// // fields[key] = "Object";
// // fields[key] = mongoSchemaToType(value);
// } else {
// const fieldType = getFieldTypeFromValue(value);
// fields[key] = fieldType;
// }
// }
for (const [key, value] of Object.entries(schema)) {
console.log("🚀 ~ file: convert_types.ts:105 ~ mongoSchemaToType ~ value:", value)
if (Array.isArray(value)) {
fields[key] = "Array";
// return fields;
// }
if (value.length > 0) {
const subType = getFieldTypeFromValue(value[0]);
if (subType === "Object") {
fields[key] = [mongoSchemaToType(value[0])];
} else {
fields[key] = [subType];
}
}
// } else if (typeof value === "object" && value !== null) {
// fields[key] = "Object";
// fields[key] = mongoSchemaToType(value);
} else {
const fieldType = getFieldTypeFromValue(value);
fields[key] = fieldType;
}
}
// async function getSchemaFromCollection(
// uri: string,
// dbName: string,
// collectionName: string,
// sampleSize = 1000,
// ): Promise<Schema> {
// const client = new MongoClient(uri);
// await client.connect();
// const db = client.db(dbName);
// const collection = db.collection(collectionName);
// const stats = await db.command({ collStats: collectionName });
// console.log(
// "🚀 ~ file: convert_types.ts:56 ~ getSchemaFromCollection ~ stats:",
// stats,
// );
// // Alanların tiplerini elde et
// const fieldTypes: { [key: string]: string } = {};
// for (const key in stats["fields"]) {
// const fieldStats = stats["fields"][key];
// fieldTypes[key] = fieldStats["type"];
// }
return fields;
}
// const sampleDocs = await collection.aggregate([{
// $sample: { size: sampleSize },
// }]).toArray();
// // console.log("🚀 ~ file: convert_types.ts:16 ~ getSchemaFromCollection ~ sampleDocs:", sampleDocs)
// await client.close();
// const schema: Record<string, BSON.Document> = {};
// sampleDocs.forEach((doc) => {
// Object.entries(doc).forEach(([key, value]) => {
// schema[key] = value;
// });
// });
// return schema;
// }
// // Usage example
// getSchemaFromCollection(
// "mongodb://127.0.0.1:27017",
// "mestgps",
// "takip_gps_yeni",
// ).then((schema) => {
// const data = mongoSchemaToType(schema);
// for (const prop in data) {
// console.log("ccc", data[prop], typeof data[prop]);
// if (typeof data[prop] === "string") {
// data[prop] = data[prop].replace(/^"(.*)"$/, "$1").replace(
// /^'(.*)'$/,
// "$1",
// );
// }
// }
// console.log(data);
async function getSchemaFromCollection(uri: string, dbName: string, collectionName: string, sampleSize: number = 1000): Promise<Schema> {
const client = new MongoClient(uri);
await client.connect();
const db = client.db(dbName);
const collection = db.collection(collectionName);
const stats = await db.command({ collStats: collectionName });
console.log("🚀 ~ file: convert_types.ts:56 ~ getSchemaFromCollection ~ stats:", stats)
// Alanların tiplerini elde et
const fieldTypes: { [key: string]: string } = {};
for (const key in stats['fields']) {
const fieldStats = stats['fields'][key];
fieldTypes[key] = fieldStats['type'];
}
// // const schema = {};
const sampleDocs = await collection.aggregate([{ $sample: { size: sampleSize } }]).toArray();
// console.log("🚀 ~ file: convert_types.ts:16 ~ getSchemaFromCollection ~ sampleDocs:", sampleDocs)
await client.close();
const schema: any = {};
sampleDocs.forEach((doc) => {
Object.entries(doc).forEach(([key, value]) => {
schema[key] = value
});
});
return schema;
}
// Usage example
getSchemaFromCollection('mongodb://127.0.0.1:27017', 'mestgps', 'takip_gps_yeni').then(async (schema) => {
const data = mongoSchemaToType(schema)
for (let prop in data) {
console.log("ccc", data[prop], typeof data[prop])
if (typeof data[prop] === 'string') {
data[prop] = data[prop].replace(/^"(.*)"$/, '$1').replace(/^'(.*)'$/, '$1');
}
}
console.log(data);
// const schema = {};
// console.log(schema);
// console.log(interfaceCode);
});
// // console.log(schema);
// // console.log(interfaceCode);
// });

@ -1,5 +1,5 @@
const defFunc = () => {
console.log("hello")
}
console.log("hello");
};
export default defFunc;

@ -0,0 +1,140 @@
export type TCanbusDataInput = {
/** #1. Devre servis fren hava basıncı kPa */
AIR11?: string;
/** #2. Devre servis fren hava basıncı kPa */
AIR12?: string;
/** #Ortam sıcaklığı °C */
AMB?: string;
/** #Aks lokasyonu 2 byte hex */
AXL?: string;
/** #Aks ağırlığı Kg */
AXW?: string;
/** #Toplam araç ağırlığı 10*KG */
CVF?: string;
/** #Motor soğutma suyu sıcaklığı °C */
ECT?: string;
/** #Error */
ERR?: string;
/** #Motor devri RPM */
ES?: string;
/** #Toplam yakıt kullanımı */
ETFU?: string;
/** #Motorun toplam çalışma süresi */
ETHO?: string;
/** #Yakıt tüketimi */
ETRFU?: string;
/** #Yakıt seviyesi % */
FL?: string;
/** #Yakıt Tüketimi */
FR?: string;
/** #SW ve desteklenen özellikler 10 byte hex */
FSSI?: string;
/** #Yüksek çözünürlüklü toplam yakıt tüketimi 0.001L */
HETFU?: string;
/** #Toplam kat edilen mesafe Km */
HRVD?: string;
/** #Servise kalan km */
SRV?: string;
/** #Takoraf bilgileri 12 byte hex(Detaylı bilgi için firmamız ile temas kurunuz) */
TCO1?: string;
/** #VT */
VT?: string;
/** #Araç Hızı K/s */
WS?: string;
/** #X Koordinat */
X?: string;
/** #Y Koordinat */
Y?: string;
};
export enum EDataTipi {
Canbus = "canbus",
Cihazbilgi = "cihazbilgi",
GeofenceOnay = "geofence_onay",
GpsHata = "gps_hata",
Gsmno = "gsmno",
ProximityKart = "proximity_kart",
Undefined = "undefined",
}
export type TCihazDataType = {
ARACID?: number;
CIHAZ_DATA?: TCihazData;
DATA_TIPI?: EDataTipi;
IMEI?: string;
};
export enum EGpsAccuracy {
AlwaysSameData = "always_same_data",
AnyGpsData = "any_gps_data",
EstimatedGpsData = "estimated_gps_data",
Good = "good",
GpsAntennaError = "gps_antenna_error",
High = "high",
InsufficientSatellites = "insufficient_satellites",
InvalidData = "invalid_data",
Lbs = "lbs",
Low = "low",
Normal = "normal",
}
export type TCihazData = {
BILDIRIM_GONDERME?: boolean;
CANBUS_DATA?: TCanbusDataInput;
CIHAZ_GSM?: string;
CIHAZ_MODEL?: string;
CIHAZ_VERSION?: string;
GEOFENCE_DURUM?: number;
GEOFENCE_NO?: number;
GIRIS_CIKIS?: number;
GIRIS_TIPI?: string;
GPS_DOGRULUK?: EGpsAccuracy;
GPS_HATA?: number;
KONTAK?: number;
KONTAK_NO?: string;
MESAJ_TIPI?: string;
OZEL_KOD?: string;
PROXIMITY_ID?: string;
TAKIP_UPDATE?: boolean;
TELEMETRIK_DEGER?: string;
TRANS_ID?: number;
};
export enum EAlarmTypes {
AcilDurum = "acil_durum",
AniDurma = "ani_durma",
AniHizlanma = "ani_hizlanma",
AracStart = "arac_start",
AracStop = "arac_stop",
DarbeAlarm = "darbe_alarm",
DepoKapak = "depo_kapak",
Duraklama = "duraklama",
GucKesik = "guc_kesik",
HizSiniri = "hiz_siniri",
KazaUyarisi = "kaza_uyarisi",
MaxWait = "max_wait",
MesaiSaati = "mesai_saati",
NoktaAlarm = "nokta_alarm",
SarsintiAlarm = "sarsinti_alarm",
SicaklikSensoru = "sicaklik_sensoru",
Undefined = "undefined",
YakitUyarisi = "yakit_uyarisi",
}
export type TAlarmObjeInput = {
ARACGPSID?: number;
ARACID: number;
BOYLAM: string;
BOYLAM_F: number;
CIHAZ_DATA: TCihazData;
EMAIL?: string;
ENLEM: string;
ENLEM_F: number;
HIZ?: number;
IMEI?: string;
MESAJ?: string;
MONGO_ARACGPSID?: string;
PLAKA?: string;
SENSOR: EAlarmTypes;
TARIH: string;
};

@ -1,343 +0,0 @@
export interface TakipGps {
_id: string;
TGID: number;
ARACID: number;
MUSTERIID: number;
BOLGEID: number;
BAYIID: number;
KULLANICIID: number;
TARIH: Date;
ENLEM: string;
BOYLAM: string;
HIZ: number;
YON: number;
KONTAK: number;
INDEKS: number;
TOPLAMKM: number;
GUNLUKKM: number;
AKUKESIK: number;
SICAKLIKLIMIT: number;
SICAKLIKDEGER: string;
HIZLIMIT: number;
MOTORBLOKAJ: number;
YURTDISIGPRS: number;
MARKA: string;
PORTNO: string;
IMEI: string;
GSM: string;
ARACTANIM: string;
PLAKA: string;
TONAJ: string;
MODELYILI: number;
KAYITKM: string;
KAYITTARIH: Date;
UPDATETARIH: Date;
AYAR: number;
MARKER: string;
SISTEMBILGISI: number;
VISIBLE: number;
SURUCU: string;
ARAC_SAHIBI: string;
MODEL: string;
RENK: string;
SASINO: string;
NOT: string;
AKTIF: number;
HAR_MESAJ_SURESI: string;
MESAFE_MESAJ_PERIYOT: string;
OFFLINE_MESAJ_SURESI: string;
SMS_MESAJ_SURESI: string;
TRANSID: number;
TOPLAMKMTARIH: Date;
ADRES: string;
GSMHATA: number;
GPSHATA: number;
GUNUNTOPLAMKM: number;
VNOTIF: number;
GUNUN_SON_KM: number;
BAGLANMA_TARIH: Date;
BAGLI: boolean;
BOYLAM_F: number;
ENLEM_F: number;
GPS_DOGRULUK: string;
LOC: LOC;
SUNUCUTARIH: Date;
UYDU_SAYI: number;
KOPMA_TARIH: Date;
KARTOKUTMA: string;
FOLLOWERS: string[];
UNVAN: string;
YETKILI: string;
LOC_LS: LOCLS;
KONTAK_ACTI_TARIH: Date;
KONTAK_KAPADI_TARIH: Date;
CANBUS_DATA: CANBUSDATA;
DELTAMESAFE: number;
RTCHATA: number;
MAXDURMADEVAM: number;
GSENSORDEVAM: number;
CEVRIMDISIKAYIT: number;
EKLENMETARIH: Date;
ROLANTIDEVAM: number;
updatedAt: Date;
MOTOR_BLOKAJ: number;
SLEEP: boolean;
SLEEPMODE: number;
}
export interface CANBUSDATA {
ERR: string;
}
export interface LOCLS {
coordinates: number[][];
type: string;
}
export interface LOC {
type: string;
coordinates: number[];
}
export enum Gps_Accuracy {
AlwaysSameData = 'always_same_data',
AnyGpsData = 'any_gps_data',
EstimatedGpsData = 'estimated_gps_data',
Good = 'good',
GpsAntennaError = 'gps_antenna_error',
High = 'high',
InsufficientSatellites = 'insufficient_satellites',
InvalidData = 'invalid_data',
Lbs = 'lbs',
Low = 'low',
Normal = 'normal'
}
export interface GpsElement {
DATE_TIME: Date;
LON: number;
LAT: number;
SPEED: number;
TOTAL_KM: number;
ANGLE: number;
ACCURACY: Gps_Accuracy;
SAT: number;
}
enum SLEEP_MODES {
DISABLE = 0,
GPS_SLEEP = 1,
DEEP_SLEEP = 2,
ONLINE_DEEP_SLEEP = 3,
ULTRA_SLEEP = 4,
}
enum DATA_MODES {
HomeOnStop = 0,
HomeOnMoving = 1,
RoamingOnStop = 2,
RoamingOnMoving = 3,
UnknownOnStop = 4,
UnknownOnMoving = 5
}
enum MOVEMENT_STATUS {
MovementOff = 0,
MovementOn = 1
}
export interface SLEEP {
MODE: SLEEP_MODES;
SLEEP_DATE: Date;
AWAKE_DATE: Date;
}
export interface CONNECTED {
STATE: boolean;
CONNECTED_DATE: Date;
DISCONNECTED_DATE: Date;
}
export interface IGNITION {
STATE: boolean;
ON_DATE: Date;
OFF_DATE: Date;
}
enum GNSS_STATUS {
GNSSOff = 0,
GNSSOnWithFix = 1,
GNSSOnWithoutFix = 2,
GNSSSleep = 3
}
export interface GNSS {
STATUS: GNSS_STATUS;
GNSS_PDOP: number;
GNSS_HDOP: number;
}
enum BATTERY_STATE {
Present = 0,
Unplugged = 1
}
interface VOLTAGE {
EXTERNAL_VOLT: number;
BATTERY_VOLT: number;
}
interface BATTERY {
STATE: BATTERY_STATE;
BATTERY_AMPER: number;
BATTERY_PERCENTAGE: number;
BATTERY_TEMP: number;
}
interface INPUTS {
DIGITAL_1: number;
DIGITAL_2: number;
DIGITAL_3: number;
ANALOG_1: number;
ANALOG_2: number;
ANALOG_3: number;
}
interface OUTPUTS {
DIGITAL_1: number;
DIGITAL_2: number;
DIGITAL_3: number;
ANALOG_1: number;
ANALOG_2: number;
ANALOG_3: number;
}
export interface AXIS {
x: number;
y: number;
z: number;
}
export enum BLUETOOTH_STATUS {
Disabled = 0,
EnabledNoDevice = 1,
DeviceConnectedBTv3 = 2,
DeviceConnectedBLEOnly = 3,
DeviceConnectedBLEAndBT = 4
}
export enum SD_STATUS {
NotPresent = 0,
Present = 1
}
export enum VEHICLE_STATE {
Moving = 0,
Idling = 1
}
export enum TIWNG_STATE {
Steady = 0,
Towing = 1
}
export enum CRASH_DETECTION {
RealCrashCalibrated = 1,
LimitedCrashTraceNotCalibrated = 2,
LimitedCrashTraceCalibrated = 3,
FullCrashTraceNotCalibrated = 4,
FullCrashTraceCalibrated = 5,
RealCrashNotCalibrated = 6,
FakeCrashPothole = 7,
FakeCrashSpeedCheck = 8
}
export enum iButton_CONNECTION {
NotConnected = 0,
ConnectedImmobilizer = 1,
ConnectedAuthorizedDriving = 2
}
export enum JAMMING_STATUS {
JammingStop = 0,
JammingStart = 1
}
export enum ALARM_STATUS {
Reserved = 0,
AlarmOccurred = 1
}
export enum AUTO_GEOFENCE {
LeftTargetZone = 0,
EnterTargetZone = 1
}
export enum TRIP_STATUS {
TripStop = 0,
TripStart = 1,
BusinessStatus = 2,
PrivateStatus = 3,
CustomStatus1 = 4,
CustomStatus2 = 5,
CustomStatus3 = 6,
CustomStatus4 = 7,
CustomStatus5 = 8,
CustomStatus6 = 9
}
export interface DeviceStateElement {
CONNECTED: CONNECTED;
SLEEP: SLEEP;
DATA_MODE: DATA_MODES;
MOVEMENT: MOVEMENT_STATUS;
GNSS: GNSS;
VOLTAGE: VOLTAGE;
INPUT: INPUTS;
OUTPUT: OUTPUTS;
AXIS: AXIS;
BT_STATUS: BLUETOOTH_STATUS;
SD_STATUS: SD_STATUS;
IDLING: VEHICLE_STATE;
TOWING: TIWNG_STATE;
BATTERY: BATTERY;
CRASH_DETECTION: CRASH_DETECTION;
IMMO: iButton_CONNECTION;
JAMMING: JAMMING_STATUS;
ALARM: ALARM_STATUS;
TRIP: TRIP_STATUS;
AUTO_GEOFENCE: AUTO_GEOFENCE
}
export enum NETWORK_TYPES {
ThreeG = 0,
GSM = 1,
FourG = 2,
LTE_CAT_M1 = 3,
LTE_CAT_NB1 = 4,
Unknown = 99
}
export interface GSM {
GSMNO: string;
GSM_CELL_ID: string;
GSM_AREA_CODE: string;
GSM_SIGNAL: number;
GSM_OP: string;
ICCID1: string;
ICCID2: string;
NETWORK_TYPE: NETWORK_TYPES;
}
export interface DeviceElement {
IMEI: string;
PORT: string;
GSM: GSM;
TOTAL_KM: number;
}
export interface VehicleStateElement {
IGNITION: IGNITION;
}

File diff suppressed because it is too large Load Diff

@ -1,6 +1,4 @@
import * as GraphqlServerTypes from "./graphql_server_types.ts";
export * as MestgpsMongoInterface from "./mestgps_mongo_interface.ts";
export * as ServerTypes from "./server_types.ts";
// import * as GraphqlServerTypes from "./graphql_server_types.ts";
// export * as MestgpsMongoInterface from "./mestgps_mongo_interface.ts";
// export * as ServerTypes from "./server_types.ts";

@ -1,7 +1,6 @@
import { ObjectId } from "npm:mongodb";
import { Gps_Accuracy } from "./graphql_server_types.ts";
export type MongoTakipGpsYeni = {
_id: string;
IMEI: string;
@ -70,143 +69,139 @@ export type MongoTakipGpsYeni = {
ARAC_VOLTAJ: number;
};
export type MongoTakipGpsDataByday = {
_id: ObjectId
AID: number
D: string
_id: ObjectId;
AID: number;
D: string;
LOG: Array<{
IS: number
TKMT: number
S: number
DT: Date
DI: string
IS: number;
TKMT: number;
S: number;
DT: Date;
DI: string;
L: {
type: string
coordinates: Array<number>
}
}>
UDT: Date
}
type: string;
coordinates: Array<number>;
};
}>;
UDT: Date;
};
export type MongoAssetAlarmKomut = {
_id: ObjectId
AID: number
SAVED: boolean
aas_id: ObjectId
ALARM_TYPE: string
_id: ObjectId;
AID: number;
SAVED: boolean;
aas_id: ObjectId;
ALARM_TYPE: string;
DATA_PROPS: {
SPEED_LIMIT: number
}
KID: number
MID: number
RETRIES: number
SAVED_AT: Date
SENT: boolean
SENT_AT: Date
UPDATED_AT: Date
}
SPEED_LIMIT: number;
};
KID: number;
MID: number;
RETRIES: number;
SAVED_AT: Date;
SENT: boolean;
SENT_AT: Date;
UPDATED_AT: Date;
};
export type MongoAracAyarlar = {
_id: ObjectId
AID: number
CREATEDAT: Date
FCICL: number
KULLANICIID: number
MUSTERIID: number
UPDATEDAT: Date
FCOCL: number
}
_id: ObjectId;
AID: number;
CREATEDAT: Date;
FCICL: number;
KULLANICIID: number;
MUSTERIID: number;
UPDATEDAT: Date;
FCOCL: number;
};
export type MongoSuruculer = {
_id: string
ID: number
KULLANICIID: number
MUSTERIID: number
ADSOYAD: string
KARTNO: string
EMAIL: string
EHLIYETTIP: string
TEL1: string
TEL2: string
TEL3: string
ADRES: string
IL: string
ILCE: string
SSKNO: string
TCKIMLIK: string
KAYITTARIH: Date
UPDATETARIH: string
ALAN1: string
ALAN2: string
ALAN3: string
AKTIF: number
}
_id: string;
ID: number;
KULLANICIID: number;
MUSTERIID: number;
ADSOYAD: string;
KARTNO: string;
EMAIL: string;
EHLIYETTIP: string;
TEL1: string;
TEL2: string;
TEL3: string;
ADRES: string;
IL: string;
ILCE: string;
SSKNO: string;
TCKIMLIK: string;
KAYITTARIH: Date;
UPDATETARIH: string;
ALAN1: string;
ALAN2: string;
ALAN3: string;
AKTIF: number;
};
export type MongoCanBusData = {
_id: ObjectId
AID: number
WS: string
ES: string
ECT: string
HRVD: string
VT: string
X: string
Y: string
}
_id: ObjectId;
AID: number;
WS: string;
ES: string;
ECT: string;
HRVD: string;
VT: string;
X: string;
Y: string;
};
export type ReportInput = {
_id: ObjectId
NAME: string
TYPE: string
QUERY: string
_id: ObjectId;
NAME: string;
TYPE: string;
QUERY: string;
SORTER_I: Array<{
field: string
order: string
}>
field: string;
order: string;
}>;
FILTER: Array<{
field: string
operator: string
value: Array<any>
}>
}
field: string;
operator: string;
value: Array<string>;
}>;
};
export type MongoSessions = {
_id: string
expires: Date
_id: string;
expires: Date;
session: {
cookie: {
originalMaxAge: number
expires: Date
secure: any
httpOnly: boolean
domain: any
path: string
sameSite: any
}
originalMaxAge: number;
expires: Date;
secure: string;
httpOnly: boolean;
domain: string;
path: string;
sameSite: string;
};
user: {
_id: string
username: string
pushToken: string
_id: string;
username: string;
pushToken: string;
profile: {
IP: string
EMAIL: string
KULLANICIID: number
MUSTERIID: number
ADSOYAD: string
TEL1: string
TEL2: string
IP: string;
EMAIL: string;
KULLANICIID: number;
MUSTERIID: number;
ADSOYAD: string;
TEL1: string;
TEL2: string;
APP_GENERAL_DATA: {
APP_NAME: string
LANG: string
}
}
}
}
}
APP_NAME: string;
LANG: string;
};
};
};
};
};
export type MongoAssetKomut = {
_id: ObjectId;
@ -223,7 +218,7 @@ export type MongoAssetKomut = {
SENT: boolean;
SENT_AT: Date;
UPDATED_AT: Date;
}
};
export type MongoGpsPoints = {
_id: ObjectId;
@ -296,7 +291,6 @@ export type MongoAssetAlarmSetup = {
UPDATED_AT: Date;
};
export type MongoAssetAlarmNotification = {
_id: ObjectId;
AID: number;
@ -354,7 +348,6 @@ export type MongoUsers = {
};
};
export type MongoGeoAdres = {
_id: string;
adres: string;
@ -365,7 +358,6 @@ export type MongoGeoAdres = {
createdAt: Date;
};
export type MongoIslemCihaz = {
_id: ObjectId;
ARACID: number;
@ -380,30 +372,22 @@ export type MongoIslemCihaz = {
};
export type MongoAssetAlarms = {
_id: string
ALARM_TYPE: string
aas_id: string
CREATED_AT: Date
_id: string;
ALARM_TYPE: string;
aas_id: string;
CREATED_AT: Date;
LOC: {
geometry: {
coordinates: Array<number>
type: string
}
coordinates: Array<number>;
type: string;
};
properties: {
TITLE: string
}
type: string
}
AID: number
TITLE: string;
};
type: string;
};
AID: number;
VALUE: {
SPEED: number
}
}
SPEED: number;
};
};

@ -0,0 +1,15 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAracAlarmAyar {
_id: ID;
ARACID: number;
IMEI: string;
SENSOR: string;
DEGER: string;
MUSTERIID: number;
KULLANICIID: number;
SMS: string;
EMAIL: string;
BILDIRIM: string;
AYARLANDIMI: string;
TARIH: Date;
}

@ -0,0 +1,11 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAracAyarlar {
_id: ID;
AID: number;
CREATEDAT: Date;
FCICL: number;
KULLANICIID: number;
MUSTERIID: number;
UPDATEDAT: Date;
FCOCL: number;
}

@ -0,0 +1,9 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAracGruplar {
_id: ID;
ARACID: number;
KULLANICIID: number;
MUSTERIID: number;
GRUP: ID[];
updatedAt: Date;
}

@ -0,0 +1,25 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAssetAlarmKomut {
_id: ID;
AID: number;
SAVED: boolean;
aas_id: ID;
ALARM_TYPE: string;
DATA_PROPS: DATAPROPS;
KID: number;
MID: number;
RETRIES: number;
SAVED_AT: Date;
SENT: boolean;
SENT_AT: Date;
UPDATED_AT: Date;
}
interface DATAPROPS {
SPEED_LIMIT: number;
SUDDEN_ACCEL_LIMIT_KM: number;
SUDDEN_DECEL_LIMIT_KM: number;
IDLING_MINUTE_LIMIT: number;
MIN_TEMP: number;
MAX_TEMP: number;
}

@ -0,0 +1,24 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAssetAlarmNotifications {
_id: ID;
AID: number;
ALARM_TYPE: string;
KID: number;
aas_id: string;
NOTIFY: NOTIFY;
UPDATED_AT: Date;
}
interface NOTIFY {
APP: APP;
EMAIL: EMAIL;
}
interface EMAIL {
NOTIFY: boolean;
EMAILS: string[];
}
interface APP {
NOTIFY: boolean;
}

@ -0,0 +1,28 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAssetAlarmSetup {
_id: ID;
AID: number;
ALARM_TYPE: string;
ALARM_PROPS: ALARMPROPS;
BY_DEVICE: BYDEVICE;
ENABLE: boolean;
KID: number;
UPDATED_AT: Date;
}
interface BYDEVICE {
IN_DEVICE: boolean;
SETTED: boolean;
}
interface ALARMPROPS {
SPEED_LIMIT: number;
START_TIME: string;
END_TIME: string;
SHIFT_TYPE: boolean;
SUDDEN_ACCEL_LIMIT_KM: number;
SUDDEN_DECEL_LIMIT_KM: number;
IDLING_MINUTE_LIMIT: number;
MIN_TEMP: number;
MAX_TEMP: number;
}

@ -0,0 +1,40 @@
import { ID, Maybe } from "./MongoTypes.ts";
export interface MongoAssetAlarms {
_id: ID;
ALARM_TYPE: string;
aas_id: string;
CREATED_AT: Date;
LOC: LOC;
AID: number;
VALUE: VALUE;
}
export type VALUE = {
BATT_STATE?: Maybe<boolean>;
IDLING_TIME?: Maybe<number>;
IGNITION_STATE?: Maybe<boolean>;
IMPACT_DEGREE?: Maybe<number>;
MAX_WAIT_TIME?: Maybe<number>;
POINT_ID?: Maybe<string>;
POINT_IO_TYPE?: Maybe<number>;
SHIFT_TIME?: Maybe<string>;
SHIFT_TYPE?: Maybe<boolean>;
SPEED?: Maybe<number>;
SUDDEN_KM?: Maybe<number>;
TEMP?: Maybe<number>;
};
interface LOC {
geometry: Geometry;
properties: Properties;
type: string;
}
interface Properties {
TITLE: string;
}
interface Geometry {
coordinates: number[];
type: string;
}

@ -0,0 +1,18 @@
import { ID, Maybe } from "./MongoTypes.ts";
export interface MongoAssetKomut {
_id: ID;
AID: number;
KOMUT_TYPE: string;
DATA_PROPS: IDataProps;
RETRIES: number;
SAVED: boolean;
SAVED_AT: Date;
SENT: boolean;
SENT_AT: Date;
UPDATED_AT: Date;
}
interface IDataProps {
VALUE?: Maybe<string>;
PRIORITY?: Maybe<string>;
}

@ -0,0 +1,8 @@
import { ID } from "./MongoTypes.ts";
export interface MongoAyarlarGenel {
_id: ID;
ALAN: string;
INDEX: number;
DEGER: string;
ACIKLAMA: string;
}

@ -0,0 +1,51 @@
import { ID } from "./MongoTypes.ts";
export interface MongoCanBusData {
_id: ID;
AID: number;
/** #1. Devre servis fren hava basıncı kPa */
AIR11?: string;
/** #2. Devre servis fren hava basıncı kPa */
AIR12?: string;
/** #Ortam sıcaklığı °C */
AMB?: string;
/** #Aks lokasyonu 2 byte hex */
AXL?: string;
/** #Aks ağırlığı Kg */
AXW?: string;
/** #Toplam araç ağırlığı 10*KG */
CVF?: string;
/** #Motor soğutma suyu sıcaklığı °C */
ECT?: string;
/** #Error */
ERR?: string;
/** #Motor devri RPM */
ES?: string;
/** #Toplam yakıt kullanımı */
ETFU?: string;
/** #Motorun toplam çalışma süresi */
ETHO?: string;
/** #Yakıt tüketimi */
ETRFU?: string;
/** #Yakıt seviyesi % */
FL?: string;
/** #Yakıt Tüketimi */
FR?: string;
/** #SW ve desteklenen özellikler 10 byte hex */
FSSI?: string;
/** #Yüksek çözünürlüklü toplam yakıt tüketimi 0.001L */
HETFU?: string;
/** #Toplam kat edilen mesafe Km */
HRVD?: string;
/** #Servise kalan km */
SRV?: string;
/** #Takoraf bilgileri 12 byte hex(Detaylı bilgi için firmamız ile temas kurunuz) */
TCO1?: string;
/** #VT */
VT?: string;
/** #Araç Hızı K/s */
WS?: string;
/** #X Koordinat */
X?: string;
/** #Y Koordinat */
Y?: string;
}

@ -0,0 +1,14 @@
import { ID } from "./MongoTypes.ts";
export interface MongoCihazHata {
_id: ID;
ENLEM: string;
BOYLAM: string;
PLAKA: string;
ARACID: number;
GSMHATA: number;
GPSHATA: number;
KONTAK: number;
MUSTERIID: number;
INDEKS: number;
HIZ: number;
}

@ -0,0 +1,5 @@
import { ID } from "./MongoTypes.ts";
export interface MongoCihazMarka {
_id: ID;
MARKA: string;
}

@ -0,0 +1,44 @@
export * from "./MongoAracAlarmAyar.ts";
export * from "./MongoAracAyarlar.ts";
export * from "./MongoAracGruplar.ts";
export * from "./MongoAssetAlarmKomut.ts";
export * from "./MongoAssetAlarmNotifications.ts";
export * from "./MongoAssetAlarms.ts";
export * from "./MongoAssetAlarmSetup.ts";
export * from "./MongoAssetKomut.ts";
export * from "./MongoAyarlarGenel.ts";
export * from "./MongoCanBusData.ts";
export * from "./MongoCihazHata.ts";
export * from "./MongoCihazMarka.ts";
export * from "./MongoDurakAracDurakta.ts";
export * from "./MongoDurakCeza.ts";
export * from "./MongoDurakHareketSaatSablon.ts";
export * from "./MongoDurakHareketSiralama.ts";
export * from "./MongoDurakTabelaHareket.ts";
export * from "./MongoDurakTabelalar.ts";
export * from "./MongoDurakTabelaSablonlar.ts";
export * from "./MongoGeoAdres.ts";
export * from "./MongoGpsPoints.ts";
export * from "./MongoGruplar.ts";
export * from "./MongoGsmHatlar.ts";
export * from "./MongoHatirlatma.ts";
export * from "./MongoIslemCihaz.ts";
export * from "./MongoKartHareket.ts";
export * from "./MongoKartliBinisKisiler.ts";
export * from "./MongoKartliBinisRapor.ts";
export * from "./MongoKartTemp.ts";
export * from "./MongoKomutTemp.ts";
export * from "./MongoMarkaUrun.ts";
export * from "./MongoMeteorImages.ts";
export * from "./MongoSeferRaporu.ts";
export * from "./MongoSession.ts";
export * from "./MongoSistemBilgisi.ts";
export * from "./MongoSorunBildir.ts";
export * from "./MongoSuruculer.ts";
export * from "./MongoRaporKur.ts";
export * from "./MongoTakipGpsDataByDay.ts";
export * from "./MongoTakipGpsYeni.ts";
export * from "./MongoTakipVeriAyar.ts";
export * from "./MongoTypes.ts";
export * from "./MongoUsers.ts";
export * from "./MongoYetkisizCihazlar.ts";

@ -0,0 +1,12 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakAracDurakta {
_id: ID;
ARACID: number;
SABLONID: number;
GEOTANIMID: number;
TIPI: number;
MUSTERIID: number;
GIRDICIKTI: number;
created_at: Date;
cikis_tarih: Date;
}

@ -0,0 +1,14 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakCeza {
_id: ID;
ARAC: string;
ARACID: string;
SABLONID: string;
TIP: string;
SIRA: number;
SEFER: number;
TARIH: string;
ACIKLAMA: string;
CEZASERVIS: number;
createdAt: Date;
}

@ -0,0 +1,16 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakHareketSaatSablon {
_id: ID;
hareketSablonAdi: string;
startTime: string;
endTime: string;
sablonliste: string[];
selectedWeek: string[];
ihlal: string;
limit: string;
bekleme: string;
base64Obj: string;
MUSTERIID: number;
updatedAt: Date;
createdAt: Date;
}

@ -0,0 +1,16 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakHareketSiralama {
_id: ID;
ARACID: string;
ARAC: string;
SABLONID: string;
TIP: string;
GIRDI: number;
CIKTI: number;
TARIH: string;
enteredDate: Date;
exitedDate: Date;
dateTime: Date;
SEFER: number;
SIRA: number;
}

@ -0,0 +1,14 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakTabelaHareket {
_id: ID;
GIRDI: number;
CIKTI: number;
enteredDate: Date;
ARACID: string;
ARAC: string;
SABLONID: string;
TIP: string;
TARIH: string;
dateTime: Date;
exitedDate: Date;
}

@ -0,0 +1,27 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakTabelaSablonlar {
_id: ID;
TABELA_ID: string;
MUSTERIID: number;
SABLONID: string;
TIP: string;
SABLONADI: string;
SABLONTANIM: string;
BASSAAT: string;
BITSAAT: string;
YAZI: string;
HAREKETDUE: string;
updatedDate: Date;
CreatedDate: Date;
CIKISTIME: string;
ARAC: string;
ARACID: string;
CIKISARAC: string;
CIKISARACID: string;
TRANSIT: number;
COKLU: number;
IHLAL: string;
SONRAKIARAC: string;
SONRAKIARACID: string;
YAZI2020: string;
}

@ -0,0 +1,18 @@
import { ID } from "./MongoTypes.ts";
export interface MongoDurakTabelalar {
_id: ID;
FILE: number;
TANIM: string;
IP: string;
PORT: string;
OLCU: string;
updatedDate: Date;
createdDate: Date;
MUSTERIID: number;
SHOW: number;
MULTI: number;
WEIGHT: number;
ISIK: number;
GSM: string;
SABITYAZI: string;
}

@ -0,0 +1,12 @@
import { ID } from "./MongoTypes.ts";
export interface MongoGeoAdres {
_id: ID;
adres: string;
loc: Loc;
createdAt: Date;
}
interface Loc {
type: string;
coordinates: number[];
}

@ -0,0 +1,30 @@
import { ID } from "./MongoTypes.ts";
export interface MongoGpsPoints {
_id: ID;
KID: number;
MID: number;
CREATED_AT: Date;
UPDATED_AT: Date;
STATUS: number;
ISDELETED: boolean;
LOC: LOC;
}
interface LOC {
type: string;
geometry: Geometry;
properties: Properties;
}
interface Properties {
TITLE: string;
CONTENT: string;
RADIUS: string;
ICON: string;
COLOR: string;
}
interface Geometry {
type: string;
coordinates: number[];
}

@ -0,0 +1,9 @@
import { ID } from "./MongoTypes.ts";
export interface MongoGruplar {
_id: ID;
GRUPADI: string;
KAYITTARIH: Date;
MUSTERIID: number;
KULLANICIID: number;
UPDATETARIH: Date;
}

@ -0,0 +1,12 @@
import { ID } from "./MongoTypes.ts";
export interface MongoGsmHatlar {
_id: ID;
BAYIID: string;
GSM: string;
TARIFE: string;
GSM_IMEI: string;
AKTIF: number;
KAYITTARIH: Date;
OPERATOR: string;
UPDATETARIH: Date;
}

@ -0,0 +1,13 @@
import { ID } from "./MongoTypes.ts";
export interface MongoHatirlatma {
_id: ID;
ARACID: number;
TIPI: string;
modeltarih: string;
modeltarihperiyot: string;
hat_email_text: string;
hatbaszaman: string;
gonderimAdet: number;
bakimkm: string;
bakimkmhatirlatma: string;
}

@ -0,0 +1,14 @@
import { ID } from "./MongoTypes.ts";
export interface MongoIslemCihaz {
_id: ID;
ARACID: number;
ACIKLAMA: string;
createdAt: Date;
AYDEX: string;
YILDEX: string;
CIHAZID: number;
MUSTERIID: number;
IMEI: string;
GSM: string;
SEBEP: string;
}

@ -0,0 +1,12 @@
import { ID } from "./MongoTypes.ts";
export interface RootObject {
_id: ID;
KARTNO: string;
SURUCUID: ID;
ARACID: number;
MUSTERIID: number;
PORTNO: string;
GUNDEX: string;
AYDEX: string;
createdAt: Date;
}

@ -0,0 +1,7 @@
import { ID } from "./MongoTypes.ts";
export interface MongoKartTemp {
_id: ID;
KARTNO: string;
createdAt: Date;
ARACID: number;
}

@ -0,0 +1,11 @@
import { ID } from "./MongoTypes.ts";
export interface MongoKartliBinisKisiler {
_id: ID;
ADSOYAD: string;
KARTNO: string;
DOGUMTARIH: string;
createdAt: Date;
updatedAt: Date;
MUSTERIID: number;
KULLANICIID: number;
}

@ -0,0 +1,12 @@
import { ID } from "./MongoTypes.ts";
export interface MongoKartliBinisRapor {
_id: ID;
KARTNO: string;
KISIID: string;
ARACID: number;
TARIHDEX: string;
AYYILDEX: string;
YILDEX: string;
createdAt: Date;
MUSTERIID: number;
}

@ -0,0 +1,14 @@
import { ID } from "./MongoTypes.ts";
export interface MongoKomutTemp {
_id: ID;
MUSTERIID: number;
KULLANICIID: number;
KOMUTID: number;
IMEI: string;
KOMUTADI: string;
KOMUTADI2: string;
ARACID: number;
TARIH: Date;
DEGER: string;
PAKETTIP: string;
}

@ -0,0 +1,7 @@
import { ID } from "./MongoTypes.ts";
export interface MongoMarkaUrun {
_id: ID;
URUNADI: string;
MARKA: string;
URUNID: number;
}

@ -0,0 +1,37 @@
import { ID } from "./MongoTypes.ts";
export interface MongoMeteorImages {
_id: ID;
size: number;
type: string;
name: string;
meta: string;
ext: string;
extension: string;
extensionWithDot: string;
mime: string;
"mime-type": string;
userId: string;
path: string;
versions: Versions;
_downloadRoute: string;
_collectionName: string;
isVideo: boolean;
isAudio: boolean;
isImage: boolean;
isText: boolean;
isJSON: boolean;
isPDF: boolean;
_storagePath: string;
public: boolean;
}
interface Versions {
original: Original;
}
interface Original {
path: string;
size: number;
type: string;
extension: string;
}

@ -0,0 +1,13 @@
interface InputSorter {
field?: string;
order?: string;
}
export interface ReportInput {
FILTER?: JSON;
NAME?: string;
QUERY?: string;
SORTER_I?: (InputSorter)[];
SORTER_P?: (InputSorter)[];
TYPE?: string;
}

@ -0,0 +1,37 @@
import { ID } from "./MongoTypes.ts";
export interface MongoSeferRaporu {
_id: ID;
ARACID: number;
ACISTARIH: Date;
KAPATISTARIH: Date;
ACTIENLEM: number;
ACTIBOYLAM: number;
KAPADIENLEM: number;
KAPADIBOYLAM: number;
TOPLAM_KM: number;
ACISADRES: string;
KAPATISADRES: string;
SURUCUID: string;
SEFERSURE: string;
MAXHIZ: number;
ORTALAMAHIZ: number;
TOPLAMHIZASIMSURE: number;
TOPLAMCEZALIBEKSURE: number;
KONTAKACIKBEKSURE: number;
TOPLAMBEKSURE: number;
imei: string;
basboylam: string;
bastarih: Date;
bitboylam: string;
bittarih: Date;
surucu: string;
sefer_saniye: string;
toplam_km: string;
max_hiz: string;
ort_hiz: string;
top_hiz_asim_saniye: string;
top_cezali_bek_saniye: string;
ilk_kontak_bekleme_saniye: string;
toplam_bekleme_saniye: string;
aracid: number;
}

@ -0,0 +1,61 @@
import { ID } from "./MongoTypes.ts";
export interface MongoSession {
_id: ID;
expires: Date;
session: Session;
}
interface Session {
cookie: Cookie;
user: User;
}
interface User {
_id: ID;
username: string;
pushToken: string;
profile: Profile;
}
interface Profile {
IP: string;
EMAIL: string;
KULLANICIID: number;
MUSTERIID: number;
ADSOYAD: string;
TEL1: string;
TEL2: string;
APP_GENERAL_DATA: APPGENERALDATA;
}
interface APPGENERALDATA {
APP_NAME: string;
LANG: string;
MAP_TYPE: string;
MAP_PROVIDERS: string;
SHOW_TRAFFIC: boolean;
GROUP_ASSETS: boolean;
DATA_MANAGE: DATAMANAGE;
}
interface DATAMANAGE {
TYPE: string;
VALUE: string;
NOTIFICATIONS: NOTIFICATIONS;
}
interface NOTIFICATIONS {
APP: boolean;
EMAIL: boolean;
EMAIL_INPUT: string;
}
interface Cookie {
originalMaxAge: number;
expires: Date;
secure?: string;
httpOnly: boolean;
domain?: string;
path: string;
sameSite?: string;
}

@ -0,0 +1,14 @@
import { ID } from "./MongoTypes.ts";
export interface MongoSistemBilgisi {
_id: ID;
MESAJTIP: number;
ARACID: number;
MESAJ: string;
SENSOR: string;
ENLEM_F: number;
BOYLAM_F: number;
ARACGPSID: string;
MONGO_ARACGPSID: string;
EMAIL: string;
TARIH: Date;
}

@ -0,0 +1,37 @@
import { ID } from "./MongoTypes.ts";
export interface MongoSorunBildir {
_id: ID;
tipi: string;
tel: string;
detay: string;
user: User;
username: string;
createdAt: Date;
email: string;
}
interface User {
KULLANICIID: number;
KULLANICIADI: string;
MUSTERIID: number;
ADSOYAD: string;
KAYITTARIH: Date;
UPDATETARIH: Date;
EKRAN?: string;
MAPTYPE: string;
TEL1: string;
TEL2: string;
ADRES: string;
SEHIR: string;
GIRISTARIH1: Date;
GIRISTARIH2: Date;
BLOKAJONAY: string;
NOT: string;
ARACLAR: number[];
EMAIL: string;
clustermarker: number;
SIFRE: string;
PAROLA: string;
AKTIF: number;
ENC_PAROLA: string;
}

@ -0,0 +1,27 @@
import { ID } from "./MongoTypes.ts";
export interface MongoSuruculer {
_id: ID;
ID: number;
KULLANICIID: number;
MUSTERIID: number;
ADSOYAD: string;
KARTNO: string;
EMAIL: string;
EHLIYETTIP: string;
TEL1: string;
TEL2: string;
TEL3: string;
ADRES: string;
IL: string;
ILCE: string;
SSKNO: string;
TCKIMLIK: string;
KAYITTARIH: Date;
UPDATETARIH: Date;
ALAN1: string;
ALAN2: string;
ALAN3: string;
AKTIF: number;
KARTOKUTMA: Date;
picture: string;
}

@ -0,0 +1,22 @@
import { ID } from "./MongoTypes.ts";
export interface MongoTakipGpsDataByDay {
_id: ID;
D: string;
AID: number;
LOG: LOG[];
UDT: Date;
}
interface LOG {
IS: number;
TKMT: number;
S: number;
DT: Date;
DI: string;
L: L;
}
interface L {
type: string;
coordinates: number[];
}

@ -0,0 +1,103 @@
import { ID } from "./MongoTypes.ts";
import { Gps_Accuracy } from "../graphql_server_types.ts";
export interface MongoTakipGpsYeni {
_id: ID;
TGID: number;
ARACID: number;
MUSTERIID: number;
BOLGEID: number;
BAYIID: number;
KULLANICIID: number;
TARIH: Date;
ENLEM: string;
BOYLAM: string;
HIZ: number;
YON: number;
KONTAK: number;
INDEKS: number;
TOPLAMKM: number;
GUNLUKKM: number;
AKUKESIK: number;
SICAKLIKLIMIT: number;
SICAKLIKDEGER: string;
HIZLIMIT: number;
MOTORBLOKAJ: number;
YURTDISIGPRS: number;
MARKA: string;
PORTNO: string;
IMEI: string;
GSM: string;
ARACTANIM: string;
PLAKA: string;
TONAJ: string;
MODELYILI: number;
KAYITKM: string;
KAYITTARIH: Date;
UPDATETARIH: Date;
AYAR: number;
MARKER: string;
SISTEMBILGISI: number;
VISIBLE: number;
SURUCU: string;
ARAC_SAHIBI: string;
MODEL: string;
RENK: string;
SASINO: string;
NOT: string;
AKTIF: number;
HAR_MESAJ_SURESI: string;
MESAFE_MESAJ_PERIYOT: string;
OFFLINE_MESAJ_SURESI: string;
SMS_MESAJ_SURESI: string;
TRANSID: number;
TOPLAMKMTARIH: Date;
ADRES: string;
GSMHATA: number;
GPSHATA: number;
GUNUNTOPLAMKM: number;
VNOTIF: number;
GUNUN_SON_KM: number;
BAGLANMA_TARIH: Date;
BAGLI: boolean;
BOYLAM_F: number;
ENLEM_F: number;
GPS_DOGRULUK: Gps_Accuracy;
LOC: ILoc;
SUNUCUTARIH: Date;
UYDU_SAYI: number;
KOPMA_TARIH: Date;
KARTOKUTMA: string;
FOLLOWERS: string[];
UNVAN: string;
YETKILI: string;
LOC_LS: ILocLs;
KONTAK_ACTI_TARIH: Date;
KONTAK_KAPADI_TARIH: Date;
CANBUS_DATA: ICanBusData;
DELTAMESAFE: number;
RTCHATA: number;
MAXDURMADEVAM: number;
GSENSORDEVAM: number;
CEVRIMDISIKAYIT: number;
EKLENMETARIH: Date;
ROLANTIDEVAM: number;
updatedAt: Date;
MOTOR_BLOKAJ: number;
SLEEP: boolean;
SLEEPMODE: number;
}
export interface ICanBusData {
err: string;
}
export interface ILocLs {
coordinates: number[][];
type: string;
}
export interface ILoc {
type: string;
coordinates: number[];
}

@ -0,0 +1,10 @@
import { ID } from "./MongoTypes.ts";
export interface MongoTakipVeriAyar {
_id: ID;
KONTROL: number;
EMAIL: string;
MUSTERIID: number;
KULLANICIID: number;
createdAt: Date;
updatedAt: Date;
}

@ -0,0 +1,304 @@
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;
}

@ -0,0 +1,55 @@
import { ID } from "./MongoTypes.ts";
export interface MongoUsers {
_id: ID;
createdAt: Date;
services: Services;
username: string;
profile: Profile;
}
interface Profile {
KULLANICIID: number;
KULLANICIADI: string;
SIFRE: string;
MUSTERIID: number;
ADSOYAD: string;
KAYITTARIH: Date;
UPDATETARIH: Date;
EKRAN: string;
MAPTYPE: string;
TEL1: string;
TEL2: string;
ADRES: string;
SEHIR: string;
EMAIL: string;
GIRISTARIH1: Date;
GIRISTARIH2: Date;
BLOKAJONAY: string;
NOT: string;
ARACLAR: number[];
clustermarker: number;
AKTIF: number;
PAROLA: string;
NOKTALAR: ID[];
ENC_PAROLA: string;
PHOTOURL: string;
}
interface Services {
password: Password;
resume: Resume;
}
interface Resume {
loginTokens: LoginToken[];
}
interface LoginToken {
when: Date;
hashedToken: string;
}
interface Password {
bcrypt: string;
}

@ -0,0 +1,25 @@
import { ID } from "./MongoTypes.ts";
export interface MongoYetkisiCihazlar {
_id: ID;
IMEI: string;
ADRES: string;
BOYLAM: string;
BOYLAM_F: number;
ENLEM: string;
ENLEM_F: number;
HIZ: number;
INDEKS: number;
KONTAK: number;
LOC: LOC;
PORTNO: string;
SUNUCUTARIH: Date;
TARIH: Date;
TOPLAMKM: number;
YON: number;
}
interface LOC {
type: string;
coordinates: number[];
}

@ -1,18 +1,17 @@
export type req_obj_type = {
project?: string | any;
project?: string;
sensor?: string;
baslik?: string;
icerik?: string;
gsm?: string;
emails?: string;
sensor_mesaj?: any;
deger?: string | any;
sensor_mesaj?: string;
deger?: string;
nokta_baslik?: string;
plaka?: any;
tarih?: string | any;
plaka?: string;
tarih?: string;
};
export type IDBObject = {
mysql_db_meta: {
DB: string;
@ -20,18 +19,18 @@ export type IDBObject = {
PASS: string;
HOST: string;
PORT: string;
},
};
mongo_db_meta: {
DB: string;
USER: string;
PASS: string;
HOST: string;
PORT: string;
},
};
mqtt_client_meta: {
USER: string;
PASS: string;
HOST: string;
PORT: string;
},
}
};
};

Loading…
Cancel
Save