Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / components / interaction / service.js
index ff6658b..431cfd9 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 _0x3677=['chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','name','role','stringify','null','then','update','info','catch','error','tracked','user','query','clone','body','omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions'];(function(_0x31f64d,_0x2a1914){var _0x509ff2=function(_0x23824d){while(--_0x23824d){_0x31f64d['push'](_0x31f64d['shift']());}};_0x509ff2(++_0x2a1914);}(_0x3677,0x1e9));var _0x7367=function(_0x4c71b8,_0x2c4af2){_0x4c71b8=_0x4c71b8-0x0;var _0xe5ec01=_0x3677[_0x4c71b8];return _0xe5ec01;};'use strict';var _=require(_0x7367('0x0'));var db=require(_0x7367('0x1'))['db'];var loggers={'openchannel':require(_0x7367('0x2'))(_0x7367('0x3')),'mail':require('../../config/logger')(_0x7367('0x4')),'fax':require('../../config/logger')(_0x7367('0x5')),'sms':require(_0x7367('0x2'))(_0x7367('0x6')),'chat':require(_0x7367('0x2'))(_0x7367('0x7')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x4b197a,_0x188b98,_0x12df00){if(_0x4b197a&&_0x4b197a[_[_0x7367('0x8')](_0x12df00)+_0x7367('0x9')]){return _0x4b197a[_['upperFirst'](_0x12df00)+_0x7367('0x9')];}else if(_0x4b197a&&_0x4b197a['id']){return _0x4b197a['id'];}else if(_0x188b98&&_0x188b98['id']){return _0x188b98['id'];}else{return _0x7367('0xa');}}function log(_0x25a66a,_0x529514,_0x1b2beb,_0x481ad0,_0x558568,_0x3af7f8){loggers[_0x558568[_0x7367('0xb')]()][_0x25a66a]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3af7f8[_0x7367('0xc')](),_0x529514?_0x529514['id']:null,_0x529514?_0x529514[_0x7367('0xd')]:null,_0x529514?_0x529514[_0x7367('0xe')]:null,getInteractionId(_0x1b2beb,_0x481ad0,_0x558568),_0x1b2beb?JSON[_0x7367('0xf')](_0x1b2beb):_0x7367('0x10'));}function updateUser(_0x50fcd1,_0x70f2de,_0x1dd8f4,_0xc7496,_0x5de099){db[_[_0x7367('0x8')](_0xc7496)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x70f2de,_0x1dd8f4,_0xc7496)}})[_0x7367('0x11')](function(_0x3fbb6c){if(_0x3fbb6c){return _0x3fbb6c[_0x7367('0x12')]({'UserId':_0x50fcd1?_0x50fcd1['id']:null});}})['then'](function(_0x1fb3f0){if(_0x1fb3f0){log(_0x7367('0x13'),_0x50fcd1,_0x70f2de,_0x1dd8f4,_0xc7496,_0x5de099);}})[_0x7367('0x14')](function(){log(_0x7367('0x15'),_0x50fcd1,_0x70f2de,_0x1dd8f4,_0xc7496,_0x5de099);});}exports[_0x7367('0x16')]=function(_0x52f059,_0x4a09ea){return function(_0x6e6cb8,_0x2faeac,_0x4a2b0e){var _0xfcad3b=_0x6e6cb8[_0x7367('0x17')];var _0x22e17f={};var _0x5bd032=_0x6e6cb8[_0x7367('0x18')];if(_0x22e17f){_0x22e17f=_[_0x7367('0x19')](_0x6e6cb8[_0x7367('0x1a')]);_0x22e17f=_[_0x7367('0x1b')](_0x22e17f,[_0x7367('0x1a'),'html',_0x7367('0x1c'),_0x7367('0x1d'),_0x7367('0x1e')]);}updateUser(_0xfcad3b,_0x22e17f,_0x5bd032,_0x52f059,_0x4a09ea);_0x4a2b0e(null);};};
\ No newline at end of file