Built motion from commit (unavailable).|2.5.16
[motion2.git] / server / components / interaction / service.js
index d2ec0c6..e60926e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43f3=['upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','Interaction','then','update','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','sms-interactions','whatsapp-interactions'];(function(_0x1d5025,_0x4e8f97){var _0x2a3c16=function(_0xcbd95a){while(--_0xcbd95a){_0x1d5025['push'](_0x1d5025['shift']());}};_0x2a3c16(++_0x4e8f97);}(_0x43f3,0xab));var _0x343f=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0x43f3[_0x566bdf];return _0x331215;};'use strict';var _=require('lodash');var db=require(_0x343f('0x0'))['db'];var loggers={'openchannel':require(_0x343f('0x1'))('openchannel-interactions'),'mail':require(_0x343f('0x1'))('mail-interactions'),'fax':require(_0x343f('0x1'))('fax-interactions'),'sms':require(_0x343f('0x1'))(_0x343f('0x2')),'chat':require(_0x343f('0x1'))('chat-interactions'),'whatsapp':require(_0x343f('0x1'))(_0x343f('0x3'))};function getInteractionId(_0x28d670,_0x1ba815,_0x288ae7){if(_0x28d670&&_0x28d670[_[_0x343f('0x4')](_0x288ae7)+_0x343f('0x5')]){return _0x28d670[_[_0x343f('0x4')](_0x288ae7)+_0x343f('0x5')];}else if(_0x28d670&&_0x28d670['id']){return _0x28d670['id'];}else if(_0x1ba815&&_0x1ba815['id']){return _0x1ba815['id'];}else{return _0x343f('0x6');}}function log(_0xf15a4d,_0x37e416,_0x1377de,_0x37c0b8,_0x16e683,_0x194230){loggers[_0x16e683[_0x343f('0x7')]()][_0xf15a4d](_0x343f('0x8'),_0x194230[_0x343f('0x9')](),_0x37e416?_0x37e416['id']:null,_0x37e416?_0x37e416['name']:null,_0x37e416?_0x37e416[_0x343f('0xa')]:null,getInteractionId(_0x1377de,_0x37c0b8,_0x16e683),_0x1377de?JSON['stringify'](_0x1377de):'null');}function updateUser(_0xa3f54,_0x1923ee,_0x5e965e,_0x4cea1f,_0x3dbbd3){db[_['upperFirst'](_0x4cea1f)+_0x343f('0xb')]['findOne']({'where':{'id':getInteractionId(_0x1923ee,_0x5e965e,_0x4cea1f)}})[_0x343f('0xc')](function(_0x950400){if(_0x950400){return _0x950400[_0x343f('0xd')]({'UserId':_0xa3f54?_0xa3f54['id']:null});}})[_0x343f('0xc')](function(_0x189d1b){if(_0x189d1b){log('info',_0xa3f54,_0x1923ee,_0x5e965e,_0x4cea1f,_0x3dbbd3);}})['catch'](function(){log(_0x343f('0xe'),_0xa3f54,_0x1923ee,_0x5e965e,_0x4cea1f,_0x3dbbd3);});}exports[_0x343f('0xf')]=function(_0x199774,_0x1fc4c9){return function(_0x3dd83a,_0x20a66c,_0x47a6e1){var _0xe84685=_0x3dd83a[_0x343f('0x10')];var _0x1103da={};var _0x1637d9=_0x3dd83a[_0x343f('0x11')];if(_0x1103da){_0x1103da=_[_0x343f('0x12')](_0x3dd83a[_0x343f('0x13')]);_0x1103da=_[_0x343f('0x14')](_0x1103da,[_0x343f('0x13'),_0x343f('0x15'),_0x343f('0x16'),_0x343f('0x17'),_0x343f('0x18')]);}updateUser(_0xe84685,_0x1103da,_0x1637d9,_0x199774,_0x1fc4c9);_0x47a6e1(null);};};
\ No newline at end of file
+var _0x7429=['upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction','findOne','then','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x6a27db,_0x2731a7){var _0xd814f5=function(_0x19d645){while(--_0x19d645){_0x6a27db['push'](_0x6a27db['shift']());}};_0xd814f5(++_0x2731a7);}(_0x7429,0x6f));var _0x9742=function(_0xb6d872,_0x2b982b){_0xb6d872=_0xb6d872-0x0;var _0x5b8cc9=_0x7429[_0xb6d872];return _0x5b8cc9;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x9742('0x0'))('openchannel-interactions'),'mail':require(_0x9742('0x0'))(_0x9742('0x1')),'fax':require('../../config/logger')(_0x9742('0x2')),'sms':require(_0x9742('0x0'))(_0x9742('0x3')),'chat':require(_0x9742('0x0'))(_0x9742('0x4')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0xaae8db,_0x380390,_0x4ead4b){if(_0xaae8db&&_0xaae8db[_[_0x9742('0x5')](_0x4ead4b)+_0x9742('0x6')]){return _0xaae8db[_['upperFirst'](_0x4ead4b)+_0x9742('0x6')];}else if(_0xaae8db&&_0xaae8db['id']){return _0xaae8db['id'];}else if(_0x380390&&_0x380390['id']){return _0x380390['id'];}else{return _0x9742('0x7');}}function log(_0x1ce654,_0x57107f,_0xa507f9,_0x5e459e,_0x192551,_0x179db5){loggers[_0x192551['toLowerCase']()][_0x1ce654](_0x9742('0x8'),_0x179db5[_0x9742('0x9')](),_0x57107f?_0x57107f['id']:null,_0x57107f?_0x57107f[_0x9742('0xa')]:null,_0x57107f?_0x57107f['role']:null,getInteractionId(_0xa507f9,_0x5e459e,_0x192551),_0xa507f9?JSON[_0x9742('0xb')](_0xa507f9):_0x9742('0xc'));}function updateUser(_0x405327,_0x5adbd2,_0x3e2821,_0x2055d3,_0x5693fc){db[_[_0x9742('0x5')](_0x2055d3)+_0x9742('0xd')][_0x9742('0xe')]({'where':{'id':getInteractionId(_0x5adbd2,_0x3e2821,_0x2055d3)}})[_0x9742('0xf')](function(_0x674b9f){if(_0x674b9f){return _0x674b9f['update']({'UserId':_0x405327?_0x405327['id']:null});}})[_0x9742('0xf')](function(_0x4d69d5){if(_0x4d69d5){log(_0x9742('0x10'),_0x405327,_0x5adbd2,_0x3e2821,_0x2055d3,_0x5693fc);}})[_0x9742('0x11')](function(){log(_0x9742('0x12'),_0x405327,_0x5adbd2,_0x3e2821,_0x2055d3,_0x5693fc);});}exports[_0x9742('0x13')]=function(_0x416614,_0x58c895){return function(_0x53e69d,_0x400f5f,_0x4beb18){var _0x224fea=_0x53e69d[_0x9742('0x14')];var _0x2eb668={};var _0x339a0d=_0x53e69d[_0x9742('0x15')];if(_0x2eb668){_0x2eb668=_[_0x9742('0x16')](_0x53e69d[_0x9742('0x17')]);_0x2eb668=_[_0x9742('0x18')](_0x2eb668,['body',_0x9742('0x19'),_0x9742('0x1a'),_0x9742('0x1b'),_0x9742('0x1c')]);}updateUser(_0x224fea,_0x2eb668,_0x339a0d,_0x416614,_0x58c895);_0x4beb18(null);};};
\ No newline at end of file