@alizadefaig/pos-server 1.2.16 → 1.2.17
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/app/tcp.js +10 -2
- package/package.json +1 -1
package/app/tcp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const net = require('net');
|
|
2
2
|
const {socketSendByFilter} = require("../utils");
|
|
3
|
+
// const moment = require("moment");
|
|
3
4
|
const serverSocket = require("./socket/server")();
|
|
4
5
|
|
|
5
6
|
module.exports = function (io = null) {
|
|
@@ -36,7 +37,6 @@ module.exports = function (io = null) {
|
|
|
36
37
|
const rawData = messageBuffer.toString('utf8');
|
|
37
38
|
const payload = JSON.parse(rawData);
|
|
38
39
|
|
|
39
|
-
// console.log(`Received ${expectedLength} data length: ${expectedLength}`, payload);
|
|
40
40
|
|
|
41
41
|
// payload содержит: event, company_id, to_id, data и т.д.
|
|
42
42
|
|
|
@@ -57,10 +57,18 @@ module.exports = function (io = null) {
|
|
|
57
57
|
const to = payload.to;
|
|
58
58
|
const excepts = payload.excepts;
|
|
59
59
|
const toId = payload.toId;
|
|
60
|
+
const now = Date.now();
|
|
61
|
+
// const nowUtc = moment.utc();
|
|
62
|
+
|
|
63
|
+
console.log(`Start: ${now} ${companyId} - ${JSON.stringify(payload)}`);
|
|
60
64
|
socketSendByFilter({
|
|
61
65
|
companyId,
|
|
62
66
|
eventName,
|
|
63
|
-
data
|
|
67
|
+
data: {
|
|
68
|
+
...data,
|
|
69
|
+
server_time: now,
|
|
70
|
+
// _server_time: nowUtc?.valueOf()
|
|
71
|
+
},
|
|
64
72
|
to,
|
|
65
73
|
toId,
|
|
66
74
|
excepts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alizadefaig/pos-server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.17",
|
|
4
4
|
"description": "Server in express js with Proxy to Main server if need and will work with Electron JS",
|
|
5
5
|
"homepage": "https://gitlab.com/faigalizade/pos-server#readme",
|
|
6
6
|
"bugs": {
|