Built motion from commit 129fb4d95212661e48f0db455e75d668addbaddf. Version 3.0.0...
[motion-next.git] / server / api / faxInteraction / faxInteraction.events.js
index 4fab9aa..13a504e 100644 (file)
@@ -1 +1 @@
-const a199_0x1005=['exports','setMaxListeners','emit','unreadMessages','update','length','findAll','events','undefined','FaxMessage','FaxInteraction','getUsers','addHook','Users','setDataValue'];(function(_0x45c07b,_0x1005f8){const _0x54390f=function(_0xeee7c){while(--_0xeee7c){_0x45c07b['push'](_0x45c07b['shift']());}};_0x54390f(++_0x1005f8);}(a199_0x1005,0x72));const a199_0x5439=function(_0x45c07b,_0x1005f8){_0x45c07b=_0x45c07b-0x0;let _0x54390f=a199_0x1005[_0x45c07b];return _0x54390f;};const _0x21c40f=a199_0x5439;'use strict';const EventEmitter=require(_0x21c40f('0xd')),FaxInteraction=require('../../mysqldb')['db'][_0x21c40f('0x1')],FaxMessage=require('../../mysqldb')['db'][_0x21c40f('0x0')],FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x21c40f('0x7')](0x0);const events={'afterCreate':'save','afterUpdate':_0x21c40f('0xa'),'afterDestroy':'remove'};function emitEvent(_0xeee7c){return function(_0x1f822a){const _0x14594b=a199_0x5439;_0x1f822a[_0x14594b('0x2')]({'attributes':['id'],'raw':!![]})['then'](function(_0x30d5fa){const _0x8d741=_0x14594b;return _0x1f822a[_0x8d741('0x5')](_0x8d741('0x4'),_0x30d5fa['map'](function(_0x3c34c8){return{'id':_0x3c34c8['id']};})),FaxMessage[_0x8d741('0xc')]({'where':{'FaxInteractionId':_0x1f822a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x292c24){const _0x2f5b15=_0x14594b;_0x1f822a[_0x2f5b15('0x5')](_0x2f5b15('0x9'),_0x292c24[_0x2f5b15('0xb')]),FaxInteractionEvents[_0x2f5b15('0x8')](_0xeee7c+':'+_0x1f822a['id'],_0x1f822a),FaxInteractionEvents['emit'](_0xeee7c,_0x1f822a);})['catch'](()=>{});};}for(const e in events){if(typeof events[e]!==_0x21c40f('0xe')){const event=events[e];FaxInteraction[_0x21c40f('0x3')](e,emitEvent(event));}}module[_0x21c40f('0x6')]=FaxInteractionEvents;
\ No newline at end of file
+const a237_0x2e80=['setDataValue','then','Users','unreadMessages','save','findAll','catch','emit','exports','remove','events','setMaxListeners','FaxMessage','addHook','length'];(function(_0x4d867f,_0x2def96){const _0x2e8047=function(_0x2a346c){while(--_0x2a346c){_0x4d867f['push'](_0x4d867f['shift']());}};_0x2e8047(++_0x2def96);}(a237_0x2e80,0x149));const a237_0x2a34=function(_0x4d867f,_0x2def96){_0x4d867f=_0x4d867f-0x143;let _0x2e8047=a237_0x2e80[_0x4d867f];return _0x2e8047;};const a237_0x5b823f=a237_0x2a34;'use strict';const EventEmitter=require(a237_0x5b823f(0x14e)),FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'],FaxMessage=require('../../mysqldb')['db'][a237_0x5b823f(0x150)],FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[a237_0x5b823f(0x14f)](0x0);const events={'afterCreate':a237_0x5b823f(0x148),'afterUpdate':'update','afterDestroy':a237_0x5b823f(0x14d)};function emitEvent(_0x545da0){return function(_0x4b889b){const _0x337f9a=a237_0x2a34;_0x4b889b['getUsers']({'attributes':['id'],'raw':!![]})[_0x337f9a(0x145)](function(_0x416a19){const _0xfc7577=_0x337f9a;return _0x4b889b[_0xfc7577(0x144)](_0xfc7577(0x146),_0x416a19['map'](function(_0x40f8f2){return{'id':_0x40f8f2['id']};})),FaxMessage[_0xfc7577(0x149)]({'where':{'FaxInteractionId':_0x4b889b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x31e395){const _0x32dcf7=_0x337f9a;_0x4b889b[_0x32dcf7(0x144)](_0x32dcf7(0x147),_0x31e395[_0x32dcf7(0x143)]),FaxInteractionEvents[_0x32dcf7(0x14b)](_0x545da0+':'+_0x4b889b['id'],_0x4b889b),FaxInteractionEvents[_0x32dcf7(0x14b)](_0x545da0,_0x4b889b);})[_0x337f9a(0x14a)](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];FaxInteraction[a237_0x5b823f(0x151)](e,emitEvent(event));}}module[a237_0x5b823f(0x14c)]=FaxInteractionEvents;
\ No newline at end of file