Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / components / interaction / service.js
index a9ce439..e488bea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','name','role','null','Interaction','findOne','then','info','catch','error','tracked','user','query','clone','body','html','phone','mobile','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var db=require(_0xe0bd('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xe0bd('0x1')),'mail':require(_0xe0bd('0x2'))(_0xe0bd('0x3')),'fax':require(_0xe0bd('0x2'))(_0xe0bd('0x4')),'sms':require('../../config/logger')(_0xe0bd('0x5')),'chat':require(_0xe0bd('0x2'))(_0xe0bd('0x6')),'whatsapp':require(_0xe0bd('0x2'))(_0xe0bd('0x7'))};function getInteractionId(_0x26393f,_0x217145,_0x491dc7){if(_0x26393f&&_0x26393f[_[_0xe0bd('0x8')](_0x491dc7)+_0xe0bd('0x9')]){return _0x26393f[_[_0xe0bd('0x8')](_0x491dc7)+_0xe0bd('0x9')];}else if(_0x26393f&&_0x26393f['id']){return _0x26393f['id'];}else if(_0x217145&&_0x217145['id']){return _0x217145['id'];}else{return _0xe0bd('0xa');}}function log(_0x3c47c4,_0x475265,_0x58d892,_0x561b74,_0x595dac,_0x47f96d){loggers[_0x595dac[_0xe0bd('0xb')]()][_0x3c47c4]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47f96d['toUpperCase'](),_0x475265?_0x475265['id']:null,_0x475265?_0x475265[_0xe0bd('0xc')]:null,_0x475265?_0x475265[_0xe0bd('0xd')]:null,getInteractionId(_0x58d892,_0x561b74,_0x595dac),_0x58d892?JSON['stringify'](_0x58d892):_0xe0bd('0xe'));}function updateUser(_0x5272ca,_0x1bf268,_0x436535,_0x3b2fb1,_0x20ab47){db[_[_0xe0bd('0x8')](_0x3b2fb1)+_0xe0bd('0xf')][_0xe0bd('0x10')]({'where':{'id':getInteractionId(_0x1bf268,_0x436535,_0x3b2fb1)}})[_0xe0bd('0x11')](function(_0x4f63fa){if(_0x4f63fa){return _0x4f63fa['update']({'UserId':_0x5272ca?_0x5272ca['id']:null});}})['then'](function(_0x2ff887){if(_0x2ff887){log(_0xe0bd('0x12'),_0x5272ca,_0x1bf268,_0x436535,_0x3b2fb1,_0x20ab47);}})[_0xe0bd('0x13')](function(){log(_0xe0bd('0x14'),_0x5272ca,_0x1bf268,_0x436535,_0x3b2fb1,_0x20ab47);});}exports[_0xe0bd('0x15')]=function(_0x55f304,_0x4ebe7a){return function(_0x1becc8,_0x4ac920,_0x4f36f7){var _0x418d64=_0x1becc8[_0xe0bd('0x16')];var _0x20157b={};var _0x5f22e2=_0x1becc8[_0xe0bd('0x17')];if(_0x20157b){_0x20157b=_[_0xe0bd('0x18')](_0x1becc8[_0xe0bd('0x19')]);_0x20157b=_['omit'](_0x20157b,[_0xe0bd('0x19'),_0xe0bd('0x1a'),_0xe0bd('0x1b'),'fax',_0xe0bd('0x1c')]);}updateUser(_0x418d64,_0x20157b,_0x5f22e2,_0x55f304,_0x4ebe7a);_0x4f36f7(null);};};
\ No newline at end of file
+var _0x41d9=['error','tracked','query','clone','omit','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','catch'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var db=require(_0x941d('0x1'))['db'];var loggers={'openchannel':require(_0x941d('0x2'))(_0x941d('0x3')),'mail':require(_0x941d('0x2'))(_0x941d('0x4')),'fax':require(_0x941d('0x2'))('fax-interactions'),'sms':require(_0x941d('0x2'))(_0x941d('0x5')),'chat':require('../../config/logger')(_0x941d('0x6')),'whatsapp':require(_0x941d('0x2'))('whatsapp-interactions')};function getInteractionId(_0x179094,_0x5b100e,_0x3825df){if(_0x179094&&_0x179094[_[_0x941d('0x7')](_0x3825df)+_0x941d('0x8')]){return _0x179094[_[_0x941d('0x7')](_0x3825df)+_0x941d('0x8')];}else if(_0x179094&&_0x179094['id']){return _0x179094['id'];}else if(_0x5b100e&&_0x5b100e['id']){return _0x5b100e['id'];}else{return'unknown';}}function log(_0x176430,_0x1c5e4d,_0x40afd7,_0x10d08e,_0x575883,_0x13193c){loggers[_0x575883[_0x941d('0x9')]()][_0x176430](_0x941d('0xa'),_0x13193c[_0x941d('0xb')](),_0x1c5e4d?_0x1c5e4d['id']:null,_0x1c5e4d?_0x1c5e4d[_0x941d('0xc')]:null,_0x1c5e4d?_0x1c5e4d[_0x941d('0xd')]:null,getInteractionId(_0x40afd7,_0x10d08e,_0x575883),_0x40afd7?JSON['stringify'](_0x40afd7):_0x941d('0xe'));}function updateUser(_0x55c5aa,_0x47a9b9,_0x46ee22,_0x4662bb,_0xbd3711){db[_[_0x941d('0x7')](_0x4662bb)+_0x941d('0xf')][_0x941d('0x10')]({'where':{'id':getInteractionId(_0x47a9b9,_0x46ee22,_0x4662bb)}})[_0x941d('0x11')](function(_0x45d85d){if(_0x45d85d){return _0x45d85d[_0x941d('0x12')]({'UserId':_0x55c5aa?_0x55c5aa['id']:null});}})[_0x941d('0x11')](function(_0x7df80e){if(_0x7df80e){log('info',_0x55c5aa,_0x47a9b9,_0x46ee22,_0x4662bb,_0xbd3711);}})[_0x941d('0x13')](function(){log(_0x941d('0x14'),_0x55c5aa,_0x47a9b9,_0x46ee22,_0x4662bb,_0xbd3711);});}exports[_0x941d('0x15')]=function(_0x2e5c4f,_0x20845a){return function(_0x3ac25f,_0x3c1e1a,_0x2c6ce5){var _0x4417fb=_0x3ac25f['user'];var _0x4660a1={};var _0x57f5e6=_0x3ac25f[_0x941d('0x16')];if(_0x4660a1){_0x4660a1=_[_0x941d('0x17')](_0x3ac25f['body']);_0x4660a1=_[_0x941d('0x18')](_0x4660a1,['body','html',_0x941d('0x19'),_0x941d('0x1a'),_0x941d('0x1b')]);}updateUser(_0x4417fb,_0x4660a1,_0x57f5e6,_0x2e5c4f,_0x20845a);_0x2c6ce5(null);};};
\ No newline at end of file