Built motion from commit 497d3d92.|2.5.43
[motion2.git] / server / components / interaction / service.js
index ff6658b..ef3faf1 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 _0x5065=['../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','findOne','update','info','error','user','query','clone','body','omit','phone','fax','../../mysqldb','openchannel-interactions'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5065,0x1ae));var _0x5506=function(_0xc3508c,_0x20d636){_0xc3508c=_0xc3508c-0x0;var _0x24680d=_0x5065[_0xc3508c];return _0x24680d;};'use strict';var _=require('lodash');var db=require(_0x5506('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x5506('0x1')),'mail':require(_0x5506('0x2'))(_0x5506('0x3')),'fax':require(_0x5506('0x2'))(_0x5506('0x4')),'sms':require(_0x5506('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x5506('0x5')),'whatsapp':require(_0x5506('0x2'))('whatsapp-interactions')};function getInteractionId(_0x1ba04c,_0x29d1d0,_0xeac0ec){if(_0x1ba04c&&_0x1ba04c[_[_0x5506('0x6')](_0xeac0ec)+_0x5506('0x7')]){return _0x1ba04c[_[_0x5506('0x6')](_0xeac0ec)+_0x5506('0x7')];}else if(_0x1ba04c&&_0x1ba04c['id']){return _0x1ba04c['id'];}else if(_0x29d1d0&&_0x29d1d0['id']){return _0x29d1d0['id'];}else{return'unknown';}}function log(_0x4ee3a6,_0x57d20f,_0x9405e0,_0x59f599,_0x42b347,_0xa783bc){loggers[_0x42b347['toLowerCase']()][_0x4ee3a6](_0x5506('0x8'),_0xa783bc['toUpperCase'](),_0x57d20f?_0x57d20f['id']:null,_0x57d20f?_0x57d20f['name']:null,_0x57d20f?_0x57d20f[_0x5506('0x9')]:null,getInteractionId(_0x9405e0,_0x59f599,_0x42b347),_0x9405e0?JSON[_0x5506('0xa')](_0x9405e0):_0x5506('0xb'));}function updateUser(_0xfebb94,_0x9ff9d,_0x5240d4,_0x564b1d,_0x172a6f){db[_['upperFirst'](_0x564b1d)+_0x5506('0xc')][_0x5506('0xd')]({'where':{'id':getInteractionId(_0x9ff9d,_0x5240d4,_0x564b1d)}})['then'](function(_0x11091c){if(_0x11091c){return _0x11091c[_0x5506('0xe')]({'UserId':_0xfebb94?_0xfebb94['id']:null});}})['then'](function(_0x2794bd){if(_0x2794bd){log(_0x5506('0xf'),_0xfebb94,_0x9ff9d,_0x5240d4,_0x564b1d,_0x172a6f);}})['catch'](function(){log(_0x5506('0x10'),_0xfebb94,_0x9ff9d,_0x5240d4,_0x564b1d,_0x172a6f);});}exports['tracked']=function(_0x38fa73,_0x3bd93b){return function(_0x1ac386,_0x380cc6,_0x30aea2){var _0x5e2f88=_0x1ac386[_0x5506('0x11')];var _0xb86c62={};var _0x15f440=_0x1ac386[_0x5506('0x12')];if(_0xb86c62){_0xb86c62=_[_0x5506('0x13')](_0x1ac386[_0x5506('0x14')]);_0xb86c62=_[_0x5506('0x15')](_0xb86c62,['body','html',_0x5506('0x16'),_0x5506('0x17'),'mobile']);}updateUser(_0x5e2f88,_0xb86c62,_0x15f440,_0x38fa73,_0x3bd93b);_0x30aea2(null);};};
\ No newline at end of file