Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / faxInteraction / faxInteraction.events.js
index c2b7540..d17ffb4 100644 (file)
@@ -1 +1 @@
-const a199_0x41bd=['length','map','FaxInteraction','save','unreadMessages','setMaxListeners','undefined','FaxMessage','Users','emit','catch','events','../../mysqldb','setDataValue'];(function(_0x240218,_0x41bd57){const _0xcc82df=function(_0x34d493){while(--_0x34d493){_0x240218['push'](_0x240218['shift']());}};_0xcc82df(++_0x41bd57);}(a199_0x41bd,0x148));const a199_0xcc82=function(_0x240218,_0x41bd57){_0x240218=_0x240218-0x0;let _0xcc82df=a199_0x41bd[_0x240218];return _0xcc82df;};const _0x3278d7=a199_0xcc82;'use strict';const EventEmitter=require(_0x3278d7('0x5')),FaxInteraction=require('../../mysqldb')['db'][_0x3278d7('0xa')],FaxMessage=require(_0x3278d7('0x6'))['db'][_0x3278d7('0x1')],FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3278d7('0xd')](0x0);const events={'afterCreate':_0x3278d7('0xb'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x34d493){return function(_0x25fcfc){const _0x4ccfeb=a199_0xcc82;_0x25fcfc['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x53c7ae){const _0x392690=a199_0xcc82;return _0x25fcfc[_0x392690('0x7')](_0x392690('0x2'),_0x53c7ae[_0x392690('0x9')](function(_0x235df9){return{'id':_0x235df9['id']};})),FaxMessage['findAll']({'where':{'FaxInteractionId':_0x25fcfc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3dc560){const _0x48bb07=a199_0xcc82;_0x25fcfc['setDataValue'](_0x48bb07('0xc'),_0x3dc560[_0x48bb07('0x8')]),FaxInteractionEvents['emit'](_0x34d493+':'+_0x25fcfc['id'],_0x25fcfc),FaxInteractionEvents[_0x48bb07('0x3')](_0x34d493,_0x25fcfc);})[_0x4ccfeb('0x4')](()=>{});};}for(const e in events){if(typeof events[e]!==_0x3278d7('0x0')){const event=events[e];FaxInteraction['addHook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+const a199_0x4653=['update','FaxInteraction','findAll','emit','remove','Users','setDataValue','map','getUsers','unreadMessages','catch','length','exports','events','setMaxListeners','../../mysqldb','addHook','then'];(function(_0x2ed823,_0x46538b){const _0x4d724b=function(_0x58e050){while(--_0x58e050){_0x2ed823['push'](_0x2ed823['shift']());}};_0x4d724b(++_0x46538b);}(a199_0x4653,0x175));const a199_0x4d72=function(_0x2ed823,_0x46538b){_0x2ed823=_0x2ed823-0x0;let _0x4d724b=a199_0x4653[_0x2ed823];return _0x4d724b;};const _0x4d51fe=a199_0x4d72;'use strict';const EventEmitter=require(_0x4d51fe('0x0')),FaxInteraction=require(_0x4d51fe('0x2'))['db'][_0x4d51fe('0x6')],FaxMessage=require(_0x4d51fe('0x2'))['db']['FaxMessage'],FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4d51fe('0x1')](0x0);const events={'afterCreate':'save','afterUpdate':_0x4d51fe('0x5'),'afterDestroy':_0x4d51fe('0x9')};function emitEvent(_0x58e050){return function(_0x5d2a8c){const _0x3d08be=a199_0x4d72;_0x5d2a8c[_0x3d08be('0xd')]({'attributes':['id'],'raw':!![]})[_0x3d08be('0x4')](function(_0x583459){const _0x258d2b=_0x3d08be;return _0x5d2a8c[_0x258d2b('0xb')](_0x258d2b('0xa'),_0x583459[_0x258d2b('0xc')](function(_0x2dd601){return{'id':_0x2dd601['id']};})),FaxMessage[_0x258d2b('0x7')]({'where':{'FaxInteractionId':_0x5d2a8c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d08be('0x4')](function(_0x295fb7){const _0x9582f0=_0x3d08be;_0x5d2a8c[_0x9582f0('0xb')](_0x9582f0('0xe'),_0x295fb7[_0x9582f0('0x10')]),FaxInteractionEvents[_0x9582f0('0x8')](_0x58e050+':'+_0x5d2a8c['id'],_0x5d2a8c),FaxInteractionEvents[_0x9582f0('0x8')](_0x58e050,_0x5d2a8c);})[_0x3d08be('0xf')](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];FaxInteraction[_0x4d51fe('0x3')](e,emitEvent(event));}}module[_0x4d51fe('0x11')]=FaxInteractionEvents;
\ No newline at end of file