@jcbuisson/express-x 1.6.9 → 1.6.11
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 +7 -7
package/package.json
CHANGED
package/src/server.mjs
CHANGED
|
@@ -371,7 +371,7 @@ export function expressX(prisma, options = {}) {
|
|
|
371
371
|
// delete 'from'
|
|
372
372
|
await deleteConnection(from)
|
|
373
373
|
// send acknowledge to client
|
|
374
|
-
|
|
374
|
+
socket.emit('cnx-transfer-ack', toConnection)
|
|
375
375
|
})
|
|
376
376
|
|
|
377
377
|
/*
|
|
@@ -379,7 +379,7 @@ export function expressX(prisma, options = {}) {
|
|
|
379
379
|
* Emit in return a 'client-response' message
|
|
380
380
|
*/
|
|
381
381
|
socket.on('client-request', async ({ uid, name, action, args }) => {
|
|
382
|
-
app.log('verbose', `client-request ${uid} ${name} ${action} ${JSON.stringify(args)}`)
|
|
382
|
+
app.log('verbose', `client-request ${connection.id} ${uid} ${name} ${action} ${JSON.stringify(args)}`)
|
|
383
383
|
if (name in services) {
|
|
384
384
|
const service = services[name]
|
|
385
385
|
try {
|
|
@@ -394,32 +394,32 @@ export function expressX(prisma, options = {}) {
|
|
|
394
394
|
try {
|
|
395
395
|
const result = await serviceMethod(context, ...args)
|
|
396
396
|
const trimmedResult = result ? JSON.stringify(result).slice(0, 300) : ''
|
|
397
|
-
app.log('verbose', `client-response ${uid} ${trimmedResult}`)
|
|
397
|
+
app.log('verbose', `client-response ${connection.id} ${uid} ${trimmedResult}`)
|
|
398
398
|
socket.emit('client-response', {
|
|
399
399
|
uid,
|
|
400
400
|
result,
|
|
401
401
|
})
|
|
402
402
|
} catch(err) {
|
|
403
403
|
app.log('error', err.toString())
|
|
404
|
-
|
|
404
|
+
socket.emit('client-response', {
|
|
405
405
|
uid,
|
|
406
406
|
error: err.toString(),
|
|
407
407
|
})
|
|
408
408
|
}
|
|
409
409
|
} else {
|
|
410
|
-
|
|
410
|
+
socket.emit('client-response', {
|
|
411
411
|
uid,
|
|
412
412
|
error: `there is no method named '${action}' for service '${name}'`,
|
|
413
413
|
})
|
|
414
414
|
}
|
|
415
415
|
} catch(error) {
|
|
416
|
-
|
|
416
|
+
socket.emit('client-response', {
|
|
417
417
|
uid,
|
|
418
418
|
error,
|
|
419
419
|
})
|
|
420
420
|
}
|
|
421
421
|
} else {
|
|
422
|
-
|
|
422
|
+
socket.emit('client-response', {
|
|
423
423
|
uid,
|
|
424
424
|
error: `there is no service named '${name}'`,
|
|
425
425
|
})
|