blixify-server 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/apis/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export { FirebaseWrapper } from "./fbWrapper";
|
|
|
3
3
|
export { MondayWrapper } from "./mondayWrapper";
|
|
4
4
|
export { MongoWrapper } from "./mongoWrapper";
|
|
5
5
|
export { SecurityMiddleware } from "./security";
|
|
6
|
+
export { TrackVisionWrapper } from "./trackVisionWrapper";
|
|
6
7
|
export { UploadWrapper } from "./uploadWrapper";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/apis/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/apis/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UploadWrapper = exports.SecurityMiddleware = exports.MongoWrapper = exports.MondayWrapper = exports.FirebaseWrapper = exports.CryptoMiddleware = void 0;
|
|
3
|
+
exports.UploadWrapper = exports.TrackVisionWrapper = exports.SecurityMiddleware = exports.MongoWrapper = exports.MondayWrapper = exports.FirebaseWrapper = exports.CryptoMiddleware = void 0;
|
|
4
4
|
var crypto_1 = require("./crypto");
|
|
5
5
|
Object.defineProperty(exports, "CryptoMiddleware", { enumerable: true, get: function () { return crypto_1.CryptoMiddleware; } });
|
|
6
6
|
var fbWrapper_1 = require("./fbWrapper");
|
|
@@ -11,5 +11,7 @@ var mongoWrapper_1 = require("./mongoWrapper");
|
|
|
11
11
|
Object.defineProperty(exports, "MongoWrapper", { enumerable: true, get: function () { return mongoWrapper_1.MongoWrapper; } });
|
|
12
12
|
var security_1 = require("./security");
|
|
13
13
|
Object.defineProperty(exports, "SecurityMiddleware", { enumerable: true, get: function () { return security_1.SecurityMiddleware; } });
|
|
14
|
+
var trackVisionWrapper_1 = require("./trackVisionWrapper");
|
|
15
|
+
Object.defineProperty(exports, "TrackVisionWrapper", { enumerable: true, get: function () { return trackVisionWrapper_1.TrackVisionWrapper; } });
|
|
14
16
|
var uploadWrapper_1 = require("./uploadWrapper");
|
|
15
17
|
Object.defineProperty(exports, "UploadWrapper", { enumerable: true, get: function () { return uploadWrapper_1.UploadWrapper; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WrapperLib } from "./mongoWrapper";
|
|
2
|
+
export declare class TrackVisionWrapper {
|
|
3
|
+
static readonly BASE_URL: string;
|
|
4
|
+
username: string;
|
|
5
|
+
password: string;
|
|
6
|
+
lib: WrapperLib;
|
|
7
|
+
constructor(username: string, password: string, lib: WrapperLib);
|
|
8
|
+
handleSafeTruckRequest: (endpoint: string, data: any) => Promise<any>;
|
|
9
|
+
initGetVehiclesPositionData: (req: any, res: any) => Promise<void>;
|
|
10
|
+
initGetVehiclePositionDataByPlateNo: (req: any, res: any) => Promise<void>;
|
|
11
|
+
initGetVehicleHistoricalPlayback: (req: any, res: any) => Promise<void>;
|
|
12
|
+
initGetVehicleListing: (req: any, res: any) => Promise<void>;
|
|
13
|
+
initGetVehicleLicenseDocuments: (req: any, res: any) => Promise<void>;
|
|
14
|
+
initGetGeofenceListing: (req: any, res: any) => Promise<void>;
|
|
15
|
+
initGetGeofenceNotification: (req: any, res: any) => Promise<void>;
|
|
16
|
+
init: () => any;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=trackVisionWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackVisionWrapper.d.ts","sourceRoot":"","sources":["../../src/apis/trackVisionWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAkC;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,UAAU,CAAC;gBAEJ,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU;IAM/D,sBAAsB,aAAoB,MAAM,QAAQ,GAAG,kBAoBzD;IAEF,2BAA2B,QAAe,GAAG,OAAO,GAAG,mBAUrD;IAEF,mCAAmC,QAAe,GAAG,OAAO,GAAG,mBAW7D;IAEF,gCAAgC,QAAe,GAAG,OAAO,GAAG,mBAe1D;IAEF,qBAAqB,QAAe,GAAG,OAAO,GAAG,mBAU/C;IAEF,8BAA8B,QAAe,GAAG,OAAO,GAAG,mBAUxD;IAEF,sBAAsB,QAAe,GAAG,OAAO,GAAG,mBAUhD;IAEF,2BAA2B,QAAe,GAAG,OAAO,GAAG,mBAcrD;IAEF,IAAI,YA0DF;CACH"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TrackVisionWrapper = void 0;
|
|
13
|
+
class TrackVisionWrapper {
|
|
14
|
+
constructor(username, password, lib) {
|
|
15
|
+
this.handleSafeTruckRequest = (endpoint, data) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const response = yield fetch(`${TrackVisionWrapper.BASE_URL}${endpoint}`, {
|
|
17
|
+
method: "POST",
|
|
18
|
+
headers: {
|
|
19
|
+
"Content-Type": "application/json",
|
|
20
|
+
},
|
|
21
|
+
body: JSON.stringify(Object.assign({ username: this.username, password: this.password }, data)),
|
|
22
|
+
});
|
|
23
|
+
const result = yield response.json();
|
|
24
|
+
if (result.isERROR) {
|
|
25
|
+
throw new Error(result.errorMessage);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
});
|
|
29
|
+
this.initGetVehiclesPositionData = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
try {
|
|
31
|
+
const result = yield this.handleSafeTruckRequest("/api2/gps/getVehiclePositionData", {});
|
|
32
|
+
res.send(result);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
res.status(400).json({ err: err.message || err });
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
this.initGetVehiclePositionDataByPlateNo = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
const { plateNo } = req.body;
|
|
41
|
+
const result = yield this.handleSafeTruckRequest("/api2/gps/getVehiclePositionDataByPlateNo", { plateNo });
|
|
42
|
+
res.send(result);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
res.status(400).json({ err: err.message || err });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
this.initGetVehicleHistoricalPlayback = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
try {
|
|
50
|
+
const { plateNo, fromDateTime, toDateTime } = req.body;
|
|
51
|
+
const result = yield this.handleSafeTruckRequest("/api2/gps/getHistoricalPB", {
|
|
52
|
+
plateNo,
|
|
53
|
+
fromDateTime,
|
|
54
|
+
toDateTime,
|
|
55
|
+
});
|
|
56
|
+
res.send(result);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
res.status(400).json({ err: err.message || err });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this.initGetVehicleListing = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
try {
|
|
64
|
+
const result = yield this.handleSafeTruckRequest("/api2/vehicle/getVehicleListingData", {});
|
|
65
|
+
res.send(result);
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
res.status(400).json({ err: err.message || err });
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
this.initGetVehicleLicenseDocuments = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
try {
|
|
73
|
+
const result = yield this.handleSafeTruckRequest("/api2/vehicle/getVehiclesLicenseDocumentsData", {});
|
|
74
|
+
res.send(result);
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
res.status(400).json({ err: err.message || err });
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
this.initGetGeofenceListing = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
try {
|
|
82
|
+
const result = yield this.handleSafeTruckRequest("/api2/gps/getGeofence", {});
|
|
83
|
+
res.send(result);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
res.status(400).json({ err: err.message || err });
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
this.initGetGeofenceNotification = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
try {
|
|
91
|
+
const { fromDateTime, toDateTime } = req.body;
|
|
92
|
+
const result = yield this.handleSafeTruckRequest("/api2/gps/getGeofenceNotification", {
|
|
93
|
+
fromDateTime,
|
|
94
|
+
toDateTime,
|
|
95
|
+
});
|
|
96
|
+
res.send(result);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
res.status(400).json({ err: err.message || err });
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
this.init = () => {
|
|
103
|
+
const router = this.lib.express.Router();
|
|
104
|
+
/**
|
|
105
|
+
* @Input :
|
|
106
|
+
* None
|
|
107
|
+
*/
|
|
108
|
+
router.post("/getVehiclesPositionData", this.initGetVehiclesPositionData);
|
|
109
|
+
/**
|
|
110
|
+
* @Input :
|
|
111
|
+
* plateNo - string
|
|
112
|
+
*/
|
|
113
|
+
router.post("/getVehiclePositionDataByPlateNo", this.initGetVehiclePositionDataByPlateNo);
|
|
114
|
+
/**
|
|
115
|
+
* @Input :
|
|
116
|
+
* plateNo - string
|
|
117
|
+
* fromDateTime - string (Optional)
|
|
118
|
+
* toDateTime - string (Optional)
|
|
119
|
+
*/
|
|
120
|
+
router.post("/getVehicleHistoricalPlayback", this.initGetVehicleHistoricalPlayback);
|
|
121
|
+
/**
|
|
122
|
+
* @Input :
|
|
123
|
+
* None
|
|
124
|
+
*/
|
|
125
|
+
router.post("/getVehicleListing", this.initGetVehicleListing);
|
|
126
|
+
/**
|
|
127
|
+
* @Input :
|
|
128
|
+
* None
|
|
129
|
+
*/
|
|
130
|
+
router.post("/getVehicleLicenseDocuments", this.initGetVehicleLicenseDocuments);
|
|
131
|
+
/**
|
|
132
|
+
* @Input :
|
|
133
|
+
* None
|
|
134
|
+
*/
|
|
135
|
+
router.post("/getGeofenceListing", this.initGetGeofenceListing);
|
|
136
|
+
/**
|
|
137
|
+
* @Input :
|
|
138
|
+
* fromDateTime - string
|
|
139
|
+
* toDateTime - string
|
|
140
|
+
*/
|
|
141
|
+
router.post("/getGeofenceNotification", this.initGetGeofenceNotification);
|
|
142
|
+
return router;
|
|
143
|
+
};
|
|
144
|
+
this.username = username;
|
|
145
|
+
this.password = password;
|
|
146
|
+
this.lib = lib;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.TrackVisionWrapper = TrackVisionWrapper;
|
|
150
|
+
TrackVisionWrapper.BASE_URL = "http://trackvision2.ddns.net";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blixify-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/apis/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"start:auth": "cd dist && node authServer.js",
|
|
28
28
|
"start:aws": "cd dist && node awsServer.js",
|
|
29
29
|
"start:monday": "cd dist && node mondayServer.js",
|
|
30
|
+
"start:trackVision": "cd dist && node trackVisionServer.js",
|
|
30
31
|
"install:husky": "yarn husky install"
|
|
31
32
|
},
|
|
32
33
|
"config": {
|