Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index ff6658b..1fb57d0 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 _0x241f=['Interaction','findOne','then','info','error','tracked','query','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null'];(function(_0x3fa163,_0x13729c){var _0x4f99a4=function(_0x5f1018){while(--_0x5f1018){_0x3fa163['push'](_0x3fa163['shift']());}};_0x4f99a4(++_0x13729c);}(_0x241f,0x1e8));var _0xf241=function(_0x12a62c,_0xc9c41a){_0x12a62c=_0x12a62c-0x0;var _0x268a58=_0x241f[_0x12a62c];return _0x268a58;};'use strict';var _=require(_0xf241('0x0'));var db=require(_0xf241('0x1'))['db'];var loggers={'openchannel':require(_0xf241('0x2'))(_0xf241('0x3')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xf241('0x2'))('fax-interactions'),'sms':require(_0xf241('0x2'))(_0xf241('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')(_0xf241('0x5'))};function getInteractionId(_0x229fb9,_0x374573,_0x55c8a8){if(_0x229fb9&&_0x229fb9[_[_0xf241('0x6')](_0x55c8a8)+_0xf241('0x7')]){return _0x229fb9[_['upperFirst'](_0x55c8a8)+_0xf241('0x7')];}else if(_0x229fb9&&_0x229fb9['id']){return _0x229fb9['id'];}else if(_0x374573&&_0x374573['id']){return _0x374573['id'];}else{return _0xf241('0x8');}}function log(_0x4b9cd2,_0x16fc41,_0x2430c6,_0x2c166f,_0x2e910c,_0x5f2ad9){loggers[_0x2e910c[_0xf241('0x9')]()][_0x4b9cd2](_0xf241('0xa'),_0x5f2ad9[_0xf241('0xb')](),_0x16fc41?_0x16fc41['id']:null,_0x16fc41?_0x16fc41[_0xf241('0xc')]:null,_0x16fc41?_0x16fc41[_0xf241('0xd')]:null,getInteractionId(_0x2430c6,_0x2c166f,_0x2e910c),_0x2430c6?JSON[_0xf241('0xe')](_0x2430c6):_0xf241('0xf'));}function updateUser(_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62){db[_['upperFirst'](_0xe28e71)+_0xf241('0x10')][_0xf241('0x11')]({'where':{'id':getInteractionId(_0x313013,_0x3f52a0,_0xe28e71)}})[_0xf241('0x12')](function(_0xc7ad33){if(_0xc7ad33){return _0xc7ad33['update']({'UserId':_0x4b8cd2?_0x4b8cd2['id']:null});}})['then'](function(_0x44ff9c){if(_0x44ff9c){log(_0xf241('0x13'),_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62);}})['catch'](function(){log(_0xf241('0x14'),_0x4b8cd2,_0x313013,_0x3f52a0,_0xe28e71,_0x31ef62);});}exports[_0xf241('0x15')]=function(_0x23b6d9,_0x364ed2){return function(_0x223d1f,_0x48dd49,_0x42c209){var _0x3271d4=_0x223d1f['user'];var _0x3f997a={};var _0x1226a8=_0x223d1f[_0xf241('0x16')];if(_0x3f997a){_0x3f997a=_['clone'](_0x223d1f['body']);_0x3f997a=_['omit'](_0x3f997a,[_0xf241('0x17'),_0xf241('0x18'),_0xf241('0x19'),_0xf241('0x1a'),_0xf241('0x1b')]);}updateUser(_0x3271d4,_0x3f997a,_0x1226a8,_0x23b6d9,_0x364ed2);_0x42c209(null);};};
\ No newline at end of file