Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / interaction / service.js
index ff6658b..989cfe8 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 _0x3280=['fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','stringify','null','Interaction','findOne','info','catch','error','tracked','user','query','clone','body','html','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x204575,_0x4011a6){var _0x44825f=function(_0x2bff5a){while(--_0x2bff5a){_0x204575['push'](_0x204575['shift']());}};_0x44825f(++_0x4011a6);}(_0x3280,0x83));var _0x0328=function(_0x234732,_0x2dc38b){_0x234732=_0x234732-0x0;var _0xed5bc7=_0x3280[_0x234732];return _0xed5bc7;};'use strict';var _=require(_0x0328('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x0328('0x1'))(_0x0328('0x2')),'mail':require('../../config/logger')(_0x0328('0x3')),'fax':require(_0x0328('0x1'))(_0x0328('0x4')),'sms':require(_0x0328('0x1'))('sms-interactions'),'chat':require(_0x0328('0x1'))(_0x0328('0x5')),'whatsapp':require('../../config/logger')(_0x0328('0x6'))};function getInteractionId(_0x108e1f,_0x2379df,_0x36e11e){if(_0x108e1f&&_0x108e1f[_[_0x0328('0x7')](_0x36e11e)+_0x0328('0x8')]){return _0x108e1f[_[_0x0328('0x7')](_0x36e11e)+_0x0328('0x8')];}else if(_0x108e1f&&_0x108e1f['id']){return _0x108e1f['id'];}else if(_0x2379df&&_0x2379df['id']){return _0x2379df['id'];}else{return'unknown';}}function log(_0xdd8d36,_0x274a02,_0x2335a9,_0x348558,_0x233d18,_0x5a80a0){loggers[_0x233d18[_0x0328('0x9')]()][_0xdd8d36](_0x0328('0xa'),_0x5a80a0['toUpperCase'](),_0x274a02?_0x274a02['id']:null,_0x274a02?_0x274a02[_0x0328('0xb')]:null,_0x274a02?_0x274a02['role']:null,getInteractionId(_0x2335a9,_0x348558,_0x233d18),_0x2335a9?JSON[_0x0328('0xc')](_0x2335a9):_0x0328('0xd'));}function updateUser(_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910){db[_[_0x0328('0x7')](_0x39f542)+_0x0328('0xe')][_0x0328('0xf')]({'where':{'id':getInteractionId(_0x1adcc8,_0x44ce6b,_0x39f542)}})['then'](function(_0x2b9f03){if(_0x2b9f03){return _0x2b9f03['update']({'UserId':_0x1f0f29?_0x1f0f29['id']:null});}})['then'](function(_0x21a897){if(_0x21a897){log(_0x0328('0x10'),_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910);}})[_0x0328('0x11')](function(){log(_0x0328('0x12'),_0x1f0f29,_0x1adcc8,_0x44ce6b,_0x39f542,_0x3e6910);});}exports[_0x0328('0x13')]=function(_0x490d00,_0x2bbba5){return function(_0xfcef53,_0x3d8c37,_0x257940){var _0x52c85e=_0xfcef53[_0x0328('0x14')];var _0x52312d={};var _0x689fc0=_0xfcef53[_0x0328('0x15')];if(_0x52312d){_0x52312d=_[_0x0328('0x16')](_0xfcef53[_0x0328('0x17')]);_0x52312d=_['omit'](_0x52312d,['body',_0x0328('0x18'),'phone',_0x0328('0x19'),_0x0328('0x1a')]);}updateUser(_0x52c85e,_0x52312d,_0x689fc0,_0x490d00,_0x2bbba5);_0x257940(null);};};
\ No newline at end of file