Built motion from commit (unavailable).|2.5.2
[motion2.git] / server / components / interaction / service.js
index ff6658b..4540bda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc9=['phone','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','chat-interactions','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','update','then','info','catch','tracked','user','query','clone','body'];(function(_0x1f194b,_0x27f748){var _0x3adb7e=function(_0x3acf84){while(--_0x3acf84){_0x1f194b['push'](_0x1f194b['shift']());}};_0x3adb7e(++_0x27f748);}(_0x9fc9,0x12e));var _0x99fc=function(_0x57474d,_0x23d835){_0x57474d=_0x57474d-0x0;var _0x12e6a5=_0x9fc9[_0x57474d];return _0x12e6a5;};'use strict';var _=require(_0x99fc('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x99fc('0x1'))(_0x99fc('0x2')),'mail':require(_0x99fc('0x1'))(_0x99fc('0x3')),'fax':require(_0x99fc('0x1'))('fax-interactions'),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x99fc('0x1'))(_0x99fc('0x4'))};function getInteractionId(_0x1da2e5,_0x83bfbc,_0x5e9262){if(_0x1da2e5&&_0x1da2e5[_[_0x99fc('0x5')](_0x5e9262)+'InteractionId']){return _0x1da2e5[_[_0x99fc('0x5')](_0x5e9262)+'InteractionId'];}else if(_0x1da2e5&&_0x1da2e5['id']){return _0x1da2e5['id'];}else if(_0x83bfbc&&_0x83bfbc['id']){return _0x83bfbc['id'];}else{return _0x99fc('0x6');}}function log(_0x58b664,_0x855468,_0x571c91,_0x3ca2a3,_0x315aea,_0x56fbf6){loggers[_0x315aea[_0x99fc('0x7')]()][_0x58b664](_0x99fc('0x8'),_0x56fbf6[_0x99fc('0x9')](),_0x855468?_0x855468['id']:null,_0x855468?_0x855468[_0x99fc('0xa')]:null,_0x855468?_0x855468[_0x99fc('0xb')]:null,getInteractionId(_0x571c91,_0x3ca2a3,_0x315aea),_0x571c91?JSON[_0x99fc('0xc')](_0x571c91):'null');}function updateUser(_0xefe8d6,_0xc65b6a,_0x152dff,_0x5f3c11,_0x4a24b1){db[_[_0x99fc('0x5')](_0x5f3c11)+_0x99fc('0xd')]['findOne']({'where':{'id':getInteractionId(_0xc65b6a,_0x152dff,_0x5f3c11)}})['then'](function(_0x43e9b8){if(_0x43e9b8){return _0x43e9b8[_0x99fc('0xe')]({'UserId':_0xefe8d6?_0xefe8d6['id']:null});}})[_0x99fc('0xf')](function(_0x1e2e33){if(_0x1e2e33){log(_0x99fc('0x10'),_0xefe8d6,_0xc65b6a,_0x152dff,_0x5f3c11,_0x4a24b1);}})[_0x99fc('0x11')](function(){log('error',_0xefe8d6,_0xc65b6a,_0x152dff,_0x5f3c11,_0x4a24b1);});}exports[_0x99fc('0x12')]=function(_0x33c42b,_0x2afeb6){return function(_0x35664b,_0x1969c1,_0x3255f5){var _0x1c012d=_0x35664b[_0x99fc('0x13')];var _0x319272={};var _0x33dbe4=_0x35664b[_0x99fc('0x14')];if(_0x319272){_0x319272=_[_0x99fc('0x15')](_0x35664b[_0x99fc('0x16')]);_0x319272=_['omit'](_0x319272,[_0x99fc('0x16'),'html',_0x99fc('0x17'),'fax',_0x99fc('0x18')]);}updateUser(_0x1c012d,_0x319272,_0x33dbe4,_0x33c42b,_0x2afeb6);_0x3255f5(null);};};
\ No newline at end of file
+var _0x7b6f=['toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','error','user','query','body','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0x7b6f,0x6c));var _0xf7b6=function(_0x5caa29,_0x2151ff){_0x5caa29=_0x5caa29-0x0;var _0x5ec017=_0x7b6f[_0x5caa29];return _0x5ec017;};'use strict';var _=require(_0xf7b6('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xf7b6('0x1'))(_0xf7b6('0x2')),'mail':require(_0xf7b6('0x1'))(_0xf7b6('0x3')),'fax':require(_0xf7b6('0x1'))(_0xf7b6('0x4')),'sms':require('../../config/logger')(_0xf7b6('0x5')),'chat':require(_0xf7b6('0x1'))(_0xf7b6('0x6')),'whatsapp':require(_0xf7b6('0x1'))(_0xf7b6('0x7'))};function getInteractionId(_0x3000ce,_0x337196,_0x3c18c6){if(_0x3000ce&&_0x3000ce[_[_0xf7b6('0x8')](_0x3c18c6)+_0xf7b6('0x9')]){return _0x3000ce[_[_0xf7b6('0x8')](_0x3c18c6)+'InteractionId'];}else if(_0x3000ce&&_0x3000ce['id']){return _0x3000ce['id'];}else if(_0x337196&&_0x337196['id']){return _0x337196['id'];}else{return _0xf7b6('0xa');}}function log(_0x3f4562,_0x842d2,_0x16ce96,_0x334491,_0x4f966a,_0x5e46e1){loggers[_0x4f966a['toLowerCase']()][_0x3f4562](_0xf7b6('0xb'),_0x5e46e1[_0xf7b6('0xc')](),_0x842d2?_0x842d2['id']:null,_0x842d2?_0x842d2[_0xf7b6('0xd')]:null,_0x842d2?_0x842d2[_0xf7b6('0xe')]:null,getInteractionId(_0x16ce96,_0x334491,_0x4f966a),_0x16ce96?JSON[_0xf7b6('0xf')](_0x16ce96):_0xf7b6('0x10'));}function updateUser(_0x389d1f,_0x386ee0,_0x4b8a0c,_0x2f3a67,_0x13731d){db[_[_0xf7b6('0x8')](_0x2f3a67)+_0xf7b6('0x11')][_0xf7b6('0x12')]({'where':{'id':getInteractionId(_0x386ee0,_0x4b8a0c,_0x2f3a67)}})[_0xf7b6('0x13')](function(_0x4fecfd){if(_0x4fecfd){return _0x4fecfd['update']({'UserId':_0x389d1f?_0x389d1f['id']:null});}})['then'](function(_0x149b5c){if(_0x149b5c){log(_0xf7b6('0x14'),_0x389d1f,_0x386ee0,_0x4b8a0c,_0x2f3a67,_0x13731d);}})['catch'](function(){log(_0xf7b6('0x15'),_0x389d1f,_0x386ee0,_0x4b8a0c,_0x2f3a67,_0x13731d);});}exports['tracked']=function(_0x27bd4a,_0x7a0a51){return function(_0x46b06d,_0x1ccf1d,_0x180f2b){var _0x5dfc28=_0x46b06d[_0xf7b6('0x16')];var _0x50a823={};var _0x20f441=_0x46b06d[_0xf7b6('0x17')];if(_0x50a823){_0x50a823=_['clone'](_0x46b06d[_0xf7b6('0x18')]);_0x50a823=_[_0xf7b6('0x19')](_0x50a823,['body',_0xf7b6('0x1a'),_0xf7b6('0x1b'),_0xf7b6('0x1c'),_0xf7b6('0x1d')]);}updateUser(_0x5dfc28,_0x50a823,_0x20f441,_0x27bd4a,_0x7a0a51);_0x180f2b(null);};};
\ No newline at end of file