@jcbuisson/express-x 1.6.15 → 1.6.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/package.json +1 -1
- package/src/server.mjs +1 -14
package/package.json
CHANGED
package/src/server.mjs
CHANGED
|
@@ -24,7 +24,6 @@ export function expressX(prisma, options = {}) {
|
|
|
24
24
|
let appHooks = []
|
|
25
25
|
|
|
26
26
|
const cnx2Socket = {}
|
|
27
|
-
const cnx2Timer = {}
|
|
28
27
|
|
|
29
28
|
async function createConnection(clientIP) {
|
|
30
29
|
const connection = await prisma.Connection.create({
|
|
@@ -67,15 +66,6 @@ export function expressX(prisma, options = {}) {
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
|
|
70
|
-
function getTimer(connectionId) {
|
|
71
|
-
return cnx2Timer[connectionId]
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function setTimer(connectionId, timer) {
|
|
75
|
-
cnx2Timer[connectionId] = timer
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
69
|
// logging function - a winston logger must be configured first
|
|
80
70
|
app.log = (severity, message) => {
|
|
81
71
|
const logger = app.get('logger')
|
|
@@ -374,8 +364,6 @@ export function expressX(prisma, options = {}) {
|
|
|
374
364
|
const toConnection = await cloneConnection(to, fromConnection)
|
|
375
365
|
// associate socket to 'to'
|
|
376
366
|
setSocket(to, socket)
|
|
377
|
-
// transfer timer from 'from' to 'to'
|
|
378
|
-
setTimer(to, getTimer(from))
|
|
379
367
|
// delete 'from'
|
|
380
368
|
await deleteConnection(from)
|
|
381
369
|
// send acknowledge to client
|
|
@@ -418,7 +406,7 @@ export function expressX(prisma, options = {}) {
|
|
|
418
406
|
} else {
|
|
419
407
|
socket.emit('client-response', {
|
|
420
408
|
uid,
|
|
421
|
-
error: new MyCustomError(`there is no method named '${action}' for service '${name}'`, missing-method),
|
|
409
|
+
error: new MyCustomError(`there is no method named '${action}' for service '${name}'`, 'missing-method'),
|
|
422
410
|
})
|
|
423
411
|
}
|
|
424
412
|
} catch(error) {
|
|
@@ -463,7 +451,6 @@ export function expressX(prisma, options = {}) {
|
|
|
463
451
|
prisma,
|
|
464
452
|
options,
|
|
465
453
|
getSocket, setSocket,
|
|
466
|
-
getTimer, setTimer,
|
|
467
454
|
createDatabaseService,
|
|
468
455
|
createService,
|
|
469
456
|
service,
|