@alizadefaig/pos-server 1.2.29 → 1.2.32
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/core/Context.js +4 -1
- package/app/core/auth/posMode.js +1 -0
- package/app/core/auth/scope.js +15 -2
- package/app/core/index.js +16 -0
- package/app/core/models/Order.js +60 -4
- package/app/core/models/OrderProduct.js +5 -0
- package/app/core/repositories/OrderRepository.js +12 -0
- package/app/core/repositories/ProductRelations.js +4 -4
- package/app/core/resources/OrderResource.js +1 -0
- package/app/core/resources/TeamResource.js +7 -1
- package/app/core/services/AuthService.js +60 -8
- package/app/core/services/InitService.js +23 -4
- package/app/core/services/OrderProductService.js +6 -0
- package/app/core/services/OrderService.js +41 -5
- package/app/core/services/PrintService.js +16 -4
- package/app/core/services/ReportService.js +87 -55
- package/app/core/support/teamSettings.js +10 -1
- package/app/core/support/terminalAccess.js +93 -0
- package/app/core/support/unlock.js +9 -1
- package/app/db/migrations/013_terminal_bindings.sql +5 -0
- package/app/netstats.js +98 -0
- package/app/sync/discovery.js +201 -38
- package/app/sync/index.js +51 -5
- package/package.json +1 -1
- package/routes/common/api/orders.js +4 -0
- package/routes/desktop/api/offline.js +1 -1
- package/routes/desktop/api/printers.js +33 -11
- package/routes/desktop/local.js +5 -1
- package/routes/server/api/platform.js +1 -1
- package/server.js +4 -0
package/server.js
CHANGED
|
@@ -13,6 +13,7 @@ const {internalGuard, originGuard} = require("./app/security");
|
|
|
13
13
|
const {isSyncEnabled} = require("./app/sync/config");
|
|
14
14
|
const multer = require('multer');
|
|
15
15
|
const {getLogger} = require("./app/logger/Log");
|
|
16
|
+
const netstats = require("./app/netstats");
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
@@ -69,6 +70,8 @@ const bodyParsers = [
|
|
|
69
70
|
express.urlencoded({extended: true, limit: BODY_LIMIT}),
|
|
70
71
|
upload.any(),
|
|
71
72
|
];
|
|
73
|
+
// Запросы из зала (не loopback) и их исход — для диагностики кассы (/local/status.net).
|
|
74
|
+
app.use(netstats.middleware);
|
|
72
75
|
// Мастер раздаёт фронт телефонам зала (LAN_FRONT): страница и её файлы открыты без ключа и
|
|
73
76
|
// токена — данных в них нет, а API за ними проверяется ниже. No-op без флага.
|
|
74
77
|
app.use(require('./app/sync/lanFront').middleware());
|
|
@@ -178,6 +181,7 @@ const runExpress = (conf = null) => {
|
|
|
178
181
|
|
|
179
182
|
// ==== Start Listen ====
|
|
180
183
|
const hostname = appConfig.host || 'localhost';
|
|
184
|
+
netstats.attach(server, {host: hostname, port});
|
|
181
185
|
server.listen(port, hostname, async () => {
|
|
182
186
|
if (hostname === 'localhost') {
|
|
183
187
|
console.log(`Server started on ${hostname} http://${hostname}:${port}`);
|